phorm_generator 1.2.0 copy "phorm_generator: ^1.2.0" to clipboard
phorm_generator: ^1.2.0 copied to clipboard

Code generator for PHORM that turns @Schema-annotated Dart models into SQL table schemas, migrations, JSON mappers and runtime metadata for SQLite, PostgreSQL and MySQL.

Changelog #

1.2.0 #

  • Added support for the new @Schema(generateFullService: ...) option. When set to false, the generator no longer emits the large pluralized static service class (e.g. Users); only the lightweight schema, table, mappers and copyWith are generated. Defaults to true, so existing output is unchanged.
  • Bumped phorm_annotations dependency to ^1.2.0, which also carries the MigrationBuilder.build() fix (previously dropped columns, timestamps, and autoIncrement when rebuilding a table via the fluent migration API).

1.1.0 #

  • Added per-dialect schema generation driven by @Schema(dialect: ...). DDL rules are now split into per-dialect strategies under src/generators/<dialect>/ (sqlite, postgres, mysql); the entry point PhormSchemaGenerator dispatches by dialect. SQLite output is unchanged; Postgres/MySQL are scaffolds.
  • Split custom SQL function generation by dialect (<dialect>_function_generator); SqlFunctionGenerator is renamed to PhormFunctionGenerator and delegates to a FunctionGenerator strategy (defaults to SQLite).
  • Requires phorm_annotations: ^1.1.0 (for SqlDialectKind).

1.0.3 #

  • Lowered analyzer constraint to >=6.4.1 <6.9.0 for compatibility with Dart 3.7 SDKs (avoids the unavailable _macros package).
  • Updated element accessors to the matching analyzer API (enclosingElement, getDisplayString(withNullability: true)).

1.0.2 #

  • Updated SDK environment constraint to >=3.7.0 <4.0.0
  • Restored analyzer dependency to ^6.11.0 to resolve build errors

1.0.1 #

  • Updated README with badges
  • Removed commented workspace resolution configuration

1.0.0 #

  • First stable release.
  • Automatically generates optimized SQL schemas (tables, indices, foreign keys) and DDL from annotations.
  • Produces type-safe relational model mixins (_$PhormModelMixin) and pluralized service accessors.
  • Provides highly optimized _$PhormModelFromJson methods for fast JSON mapping.
  • Integrates with build_runner and source_gen for hot-reloadable, automated code generation.
1
likes
150
points
427
downloads
screenshot

Documentation

API reference

Publisher

verified publisherinterlib.dev

Weekly Downloads

Code generator for PHORM that turns @Schema-annotated Dart models into SQL table schemas, migrations, JSON mappers and runtime metadata for SQLite, PostgreSQL and MySQL.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

analyzer, build, dart_style, path, phorm_annotations, source_gen

More

Packages that depend on phorm_generator