sequelize_orm_generator 0.2.0
sequelize_orm_generator: ^0.2.0 copied to clipboard
Code generator for sequelize_orm. Generates type-safe model classes, query builders, and a centralized model registry from annotated Dart classes using build_runner.
0.2.0 #
- FEAT: All generated static and instance methods now accept
Transaction? transaction— coveringfindAll,findOne,create,update,destroy,restore,truncate,count,max,min,sum,increment,decrement,save,reload, and all association helpers (getX,setX,createX,addX,removeX). - FEAT: Transactions are forwarded through internal
reload()calls insave(),update(), andrestore(), keeping reads within the same transaction boundary. - FEAT: Zone-based transaction inheritance — passing
nullallowsQueryEngineto auto-resolve the active transaction from the currentZone. - IMPROVEMENT: Updated dependency to
sequelize_orm: ^0.2.0.
0.1.5 #
- FEAT: Added support for
ENUMdata type code generation. - FEAT: Support for
@EnumPrefixannotation for configurable enum name generation. - IMPROVEMENT: Updated dependency to
sequelize_orm: ^0.1.5.
0.1.4 #
- FIX: Enhance registry generation to include seeders
- IMPROVEMENT: Widen
analyzerdependency constraint to>=9.0.0 <11.0.0to support analyzer 10.x. - IMPROVEMENT: Add package example for pub.dev scoring.
- IMPROVEMENT: Dependency bump to
sequelize_orm: ^0.1.4.
0.1.3 #
- FEAT: Generated columns now emit generic
JsonColumn<T>references (e.g.JsonColumn<List<String>>) for type-safe JSON equality checks. - FIX:
_updateFields()no longer overwrites eagerly-loaded associations with null when the bridge response omits them (e.g. aftersave(),increment(),decrement()). - IMPROVEMENT: JSON type hint extracted from
DataType.JSON(type: ...)/DataType.JSONB(type: ...)and forwarded to column generation. - FEAT: Generated
fromJsonnow uses shared parse helpers with structured error reporting (model, field, operation, row index). - FEAT: BIGINT columns generate
SequelizeBigIntfields instead of plainString. - FEAT: JSON/JSONB columns now support
type:parameter — generates correctly typedList<T>/Map<String, T>fields withparseJsonList<T>/parseJsonMap<T>parsers. - IMPROVEMENT:
TINYINT,SMALLINT,MEDIUMINTmapped toint;BIGINTtoSequelizeBigInt. - IMPROVEMENT:
findAllpasses row index tofromJsonfor per-row error context.
0.1.1 #
- FIX: generate
modelNameinstead ofnamein generated models to prevent collisions with fields namedname. - FIX: correct
@Default(...)emission for string and JSON defaults by preserving annotation source for complex literals. - FIX: always generate
originalQueryon values classes so generated query assignments are valid. - FIX: serialize
DateTimefields as ISO-8601 strings in generatedtoJson()output to avoidjsonEncodefailures. - IMPROVEMENT: make generated DateTime parsing tolerant of
DateTime, epoch integers, and string payloads. - CHORE: add file-level
ignore_for_filedirectives in generated model files to suppress known generated-code warnings.
0.1.0 #
Initial beta release of sequelize_orm_generator.
Code Generation #
- Generates type-safe model classes from
@Table-annotated Dart classes viabuild_runner. - Per-model output:
*Model(static queries),*Values(instance data),Create*/Update*(DTOs),*Columns,*Query, and*IncludeHelper.
Model Features #
- Full support for
@Tableoptions: timestamps, paranoid, underscored, freezeTableName, schema, engine, charset, version, and more. - Attribute annotations:
@PrimaryKey,@AutoIncrement,@AllowNull,@NotNull,@ColumnName,@Default,@Comment,@Unique,@Index. - Validation annotations:
@IsEmail,@IsUrl,@Len,@Min,@Max,@IsUUID,@IsIn, and more. - Data type mapping for all supported Sequelize types.
Associations #
@HasOne,@HasMany,@BelongsToannotations processed during generation.- Type-safe
IncludeHelpergenerated per model for eager loading. - Association registration code generated for the model registry.
Model Registry #
- Centralized
ModelsRegistrygenerated withdefineModels()andassociateModels(). - Automatically discovers and registers all annotated models in the project.
CLI #
- Shared CLI utilities for project scaffolding and model generation.