jao_generator 0.3.3
jao_generator: ^0.3.3 copied to clipboard
Code generator for jao ORM. Generates typed field accessors and model metadata.
[Unreleased] #
0.3.3 - 2026-03-16 #
Changed #
_extractDefaultValuenow returns typed values (int,double,bool,String) instead of stringifying all defaults- Generated
ModelFieldSchema.defaultValueemits typed literals (false,0,3.14) instead of quoted strings ('false','0') - Generated
defaultValuesmap inModelRegistrationemits typed values directly
0.3.2 - 2026-03-16 #
Fixed #
- Annotation fields inherited via superclass chain (e.g.,
uniqueandmaxLengthonEmailFieldwhich extendsCharFieldwhich extendsField) are now correctly resolvedDartObject.getField()only returns directly declared fields — added_getInheritedField()to walk the(super)chain- Applied to all annotation field reads:
unique,maxLength,defaultValue,autoNowAdd,autoNow,autoGenerate,maxDigits,decimalPlaces,storeAsInt,onDelete,to,toColumn
0.3.1 - 2026-03-16 #
Fixed #
- Generated
ModelFieldSchemanow emitsdefaultValue,maxLength,unique,precision,scale, andonDeletefrom field annotations - Migrations previously lost string lengths, default values, unique constraints, decimal precision/scale, and FK on-delete actions because the code generator did not pass these attributes through
@DateFieldnow correctly extractsautoNowAddandautoNow(was previously ignored)
0.3.0 - 2026-02-23 #
Added #
EnumFieldsupport for enum-to-database mapping:- Generates
fromRowwithEnum.values.byName()for string storage (default) - Generates
fromRowwithEnum.values[index]for int storage (storeAsInt: true) - Generates
toRowwith.nameor.indexbased on storage type - Handles nullable enum fields correctly
- Schema uses
varcharfor string-based orintegerfor int-based storage
- Generates
0.2.3 - 2026-02-09 #
Added #
defaultValuesupport for field annotations:- Extracts
defaultValuefrom@CharField,@IntegerField,@BooleanField,@FloatField, and other field types - Generates
defaultValuesmap inModelRegistrationfor runtime default value injection - Supports string, int, bool, and double default values
- Extracts
ForeignKeyInfoin schema for FK fields:- Generated
ModelFieldSchemanow includesforeignKey: ForeignKeyInfo(...)for@ForeignKeyand@OneToOneField - Enables migration generator to create proper foreign key constraints
- Supports nullable foreign key relationships
- Generated
0.2.2 - 2026-02-02 #
Fixed #
- Foreign key field type now resolves from the related model's primary key type instead of being hardcoded to
int @ForeignKeyand@OneToOneFieldto a model with@UuidPrimaryKeynow correctly generatesString/StringFieldRefinstead ofint/IntFieldRef
Added #
_resolvePkTypehelper for inspecting related model PK annotations at generation time- Tests for FK type resolution with
@UuidPrimaryKeyand@AutoFieldtargets
0.2.1 - 2026-01-01 #
Added #
- Generates
_registerMetadata()method in companion class for model metadata registration - Extracts ForeignKey/OneToOneField relationship info for proper JOIN support
- Auto-registers
ModelMetadatawithModelRegistryon first Manager access
0.2.0 - 2025-12-31 #
Changed #
fromRow()generation now uses type converter functions (dbDateTime,dbBool,dbInt,dbDouble,dbDuration) instead of direct type casts- This enables cross-database compatibility where SQLite returns String/int and PostgreSQL returns native DateTime/bool types
Fixed #
- Cross-database type compatibility issue (#4)
0.1.0 - 2025-12-28 #
- Version bump to align with jao and jao_cli packages