angel3_orm_generator 10.0.0
angel3_orm_generator: ^10.0.0 copied to clipboard
Code generators for Angel3 ORM. Generates query builder classes.
Change Log #
10.0.0 #
Breaking changes in 10.0.0 #
- Breaking: A many-to-many is loaded with a query of its pivot table and one of its other model, whose own relations are loaded too, except one back to a table being loaded, where it was joined through SQL, without them. A generated query no longer overrides
get,update,deleteorcanCompilefor its relations, and overridesloadRelationsandloadsRelationsinstead - Breaking: The key of a relation in
QueryValues, such asauthorIdof a@BelongsTo Author author, is nullable (int?), as the relation and its column may be null, where reading it before it was set threw aTypeError, and it could not be cleared - Breaking: The generator no longer uses
analyzerinternals, which broke every model with@BelongsToonanalyzer14.5.OrmBuildContext.effectiveFieldsis aList<OrmField>(ClassOrmFieldorRelationFieldImpl), as are the arguments offindPrimaryFieldInList,isSpecialId,findLocalFieldandfindForeignField. The generated code is unchanged by this
Fixes in 10.0.0 #
- HasMany: A
@HasManyis loaded with one query for all the records (WHERE key IN (...)), after them, rather than joined, which gave a row per item, of every@HasManymultiplied together, and listed an item once per row of the others; a@HasManyof an item, or of a@HasOneor@BelongsTo, is loaded in turn, where one nested in a@HasManywas always empty. The query of a@HasMany(e.g.query.todos) is the one its items are loaded with, so its conditions and order apply to them - Select:
parseRowreads each column at its place infields, so a query of some of them (select) no longer reads them from the wrong columns or past the end of the row - Relations:
parseRowparses a@HasOneor@BelongsTowith the query joined, from the columnsQuery.joinedRowfinds at runtime, where fixed offsets ignored the columns of nested joins - Names: Tables, foreign keys and migration classes keep their earlier names (
legacyModelName), thoughangel3_serialize_generatornow names generated classes otherwise:_UserEntityis stilluser_entities - Column types: A type given in
@Columnor@PrimaryKeyis used, instead of one inferred from the Dart type; enums are inferred too. Migrations use theColumnTypeconstants, which the MySQL and MariaDB runners need, givelengthonly to types that have one, and type a foreign key to a serial column as its integer - Precision: The
precisionandscaleof a@Columnare used;decimalcolumns are created withtable.decimal - Relations:
copyFromconverts a related model'sStringid to itsintcolumn, and sets it only once the model has an id. A many-to-many uses itsthroughclass's table name, an explicitforeignTableworks, and a relation whose name containsIdgets its where builder - Docs: The README tells how to install and use the package, and how to migrate from 9.x
9.1.1 #
- Fix analyzer warnings and errors
9.1.0 #
- Require Dart >= 3.13
9.0.0 #
- Require Dart >= 3.12
- Updated
analyzerto 13.0.0
8.7.0 #
- Require Dart >= 3.9
- Updated
analyzerto 8.4.x - Updated
buildto 4.0.x - Updated
source_gento 4.0.0 - Updated
RelationFieldImpl - Removed
RelationFieldImpl2
8.6.1 #
- Updated
TypeChecker.fromRuntime()toTypeChecker.typeNamed()
8.6.0 #
- Require Dart >= 3.8.0
- Updated
lintsto 6.0.0 - Updated dependencies to the latest release
- Updated
analyzerto 7.7.x - Added
FelationFieldImpl2due to changes inanalyzer7.7.x
8.5.0 #
- Updated initializer
super(parent: parent)tosuper.parentin the generated<Model>Query - Updated
_fieldstolocalFieldsin generated<Model>Query - Added support for
<Class>EntityandEntity<Class>as data model
8.4.1 #
- Update
angel3_serialize_generator
8.4.0 #
- Require Dart >= 3.6
- Updated
lintsto 5.0.0 - Updated
analyzerto 7.x - Updated dependencies to the latest release
- Fixed ORM
copyFromnullability check error - Fixed issue #98: Take @SerializableField properties into account when generating
Migration - Fixed issue #98: Take @SerializableField properties into account when generating
Query.parseRow
8.3.2 #
- Fixed analyzer warnings
8.3.1 #
- Updated dependencies
8.3.0 #
- Require Dart >= 3.3
- Updated
lintsto 4.0.0
8.2.1 #
- Updated repository link
8.2.0 #
- Updated
lintsto 3.0.0 - Fixed linter warnings
8.1.0 #
- Upgraded to
analyzer6.2.x
8.0.0 #
- Require Dart >= 3.0
7.2.0-beta.1 #
- [Breaking] Require Dart >= 2.19
- Use
@SerializableFieldproperties inQuery.parseRow
7.1.2 #
- Fixed #88 due to change in
analyzer5.3.x
7.1.1 #
- Temporily locked
analyzerto 5.2.x to resolve undocumented breaking changes in 5.3.x.
7.1.0 #
- [Breaking] Require Dart >= 2.18
- Upgraded to
analyzer5.x.x - Replaced deprecated
element2withelement
7.0.2 #
- Fixed deprecated
assignVarandassignConst
7.0.1 #
- Fixed issue #82: Removed casting for numeric fields
7.0.0 #
- Require Dart >= 2.17
- Fixed issue #75: Generated Code of ORM does not compile
6.2.0 #
- Fixed issue #68: Support for non-nullable type
- Generate default value based on
defaultValuein the@Columnannotation
6.1.0 #
- Updated to
analyzer4.x.x
6.0.1 #
- Fixed timestamp or date field to DateTime mapping
- Fixed double or float field to double mapping
6.0.0 #
- Require Dart >= 2.16
5.0.0 #
- Skipped release
4.3.0 #
- Added
where.raw()
4.2.0 #
- Added
select(List fields)
4.1.3 #
- Fixed issue #24, incorrect class casting
- Fixed
@belongsToto generate correct table creation query
4.1.2 #
- Updated linter to
package:lints
4.1.1 #
- Fixed
NumericSqlExpressionBuilderto handle nullable field - Fixed
@belongsToandManyToManycode generation - Fixed
copyFromto handle nullable relationship
4.1.0 #
- Upgraded to support
analyzer2.0.0 major release
4.0.2 #
- Fixed NNBD issues
4.0.1 #
- Added
useNullSafetySyntax: truetoDartEmitter - Updated
*Migrationclass generator to produce NNBD code - Updated
*Queryclass generator to produce NNBD code - Updated
*QueryWhereclass generator to produce NNBD code - Updated
*QueryValuesclass generator to produce NNBD code
4.0.0 #
- Fixed
BuildContextcast error
4.0.0-beta.5 #
- Fixed
ColumnTypeincorrect constructor
4.0.0-beta.4 #
- Fixed
build.yaml - Updated generated code to use
angel3packages
4.0.0-beta.3 #
- Updated README
- Fixed NNBD issues
4.0.0-beta.2 #
- Updated home page link
4.0.0-beta.1 #
- Migrated to support Dart >= 2.12 NNBD
3.0.0 #
- Migrated to work with Dart >= 2.12 Non NNBD
2.1.0-beta.2 #
- Support for custom SQL expressions.
2.1.0-beta.1 #
OrmBuildContextcaching is now local to aBuilder, sowatchshould finally always run when required. Should resolve ##85.
2.1.0-beta #
- Relationships have always generated subqueries; now these subqueries are
available as
Queryobjects on generated classes. - Support explicitly-defined join types for relations.
2.0.5 #
- Remove
ShimFieldImplcheck, which broke relations. - Fix bug where primary key type would not be emitted in migrations.
- Fix
ManyToManyignoring primary key types.
2.0.4 #
- Fix
reviveColumnand element finding to properly detect all annotations now.
2.0.3 #
- Remove
targetsinbuild.yaml.
2.0.2 #
- Change
build_configrange to">=0.3.0 <0.5.0".
2.0.1 #
- Gracefully handle
nullin enum fields. - Add
taketo whereverskipis used.
2.0.0+2 #
- Widen
analyzerdependency range.
2.0.0+1 #
- Restore
build.yaml, which at some point, got deleted.
2.0.0 #
parse->tryParsewhere used.
2.0.0-dev.7 #
- Handle
@ManyToMany. - Handle cases where the class is not a
Model.- Stop assuming things have
id, etc.
- Stop assuming things have
- Resolve a bug where the
indexTypeof@Columnannotations. would not be found. - Add
cascade: trueto drops for hasOne/hasMany/ManyToMany migrations. - Support enum default values in migrations.
2.0.0-dev.6 #
- Fix bug where an extra field would be inserted into joins and botch the result.
- Narrow analyzer dependency.
2.0.0-dev.5 #
- Implement cast-based
doublesupport. - Finish
ListSqlExpressionBuilder.
2.0.0-dev.4 #
- List generation support.
2.0.0-dev.3 #
- Add JSON/JSONB support for Maps.
2.0.0-dev.2 #
- Changes to work with
package:angel_orm@2.0.0-dev.15.
2.0.0-dev.1 #
- Generate migration files.
2.0.0-dev #
- Dart 2 updates, and more.
1.0.0-alpha+6 #
DateTimeis nowCASTon insertion and update operations.
1.0.0-alpha+3 #
Implemented @hasOne, with tests. Still missing @hasMany.
belongsToMany will likely be scrapped.
1.0.0-alpha+2 #
- Added support for
belongsTorelationships. Still missinghasOne,hasMany,belongsToMany.
1.0.0-alpha+1 #
- Closed ##12.
insertXandupdateXnow userc.camelCase, instead ofrc.snakeCase. - Closed ##13. Added
limitandoffsetproperties toXQuery. - Closed ##14. Refined the
ormethod (it now takes anXQueryWhere), and removedandandnot. - Closed ##16. Added
sortAscendingandsortDescendingtoXQuery. - Closed ##17.
deletenow usestoSqlfromXQuery. - Closed ##18.
XQuerynow supportsunionandunionAll.