flutter_instantdb_generator 0.2.0
flutter_instantdb_generator: ^0.2.0 copied to clipboard
Build-time code generator for flutter_instantdb. Emits type-safe query tables, typed transactions, and relation accessors from @InstantModel-annotated models.
Changelog #
0.2.0 #
- Emit
toMap(Model)(scalar fields) on each generated table. - Emit a
${Model}TxXextension withcreateModel/updateModel/mergeModelfor whole-model typed writes. - Emit
static const ${field}Rel = RelationRef<...>(...)per relation for typedlinkRel/unlinkRel. - Emit a
Table().tx(db)convenience returningdb.txFor(this). - Pairs with
flutter_instantdb^2.0.0.
0.1.0 #
Initial release.
- Generates a typed
InstantModelTable+ a${Model}QueryXextension (getAll/watchAll) for every class annotated with@InstantModel. @InstantFieldoverrides the stored attribute name for a field.@InstantLinkdeclares relation fields: cardinality is inferred from the field type (List<T>→ to-many,T→ to-one), and the generator emits a typed relation accessor, a recursively-typedfromRow(List<T>/T?), and astatic const ${field}Rel = RelationRef<...>(...)per relation.- Typed writes: emits
toMap(Model), a${Model}TxXextension (createModel/updateModel/mergeModel), and aTable().tx(db)convenience. - Pairs with the
flutter_instantdbruntime package.