sequelize_orm 0.2.0
sequelize_orm: ^0.2.0 copied to clipboard
A type-safe ORM for Dart powered by Sequelize. Supports PostgreSQL, MySQL, MariaDB, SQLite, and MSSQL with code generation, model annotations, associations, and query building.
0.2.0 #
- FEAT: Full Transaction support — managed (
sequelize.transaction) and unmanaged (sequelize.startUnmanagedTransaction) transactions. - FEAT: Zone-based transaction inheritance — database operations automatically participate in the active transaction within the same
Zone. - FEAT: Support for nested managed transactions.
- IMPROVEMENT: Enhanced
truncateanddestroyoptions in the JS bridge:- Added support for
cascade(PostgreSQL/MySQL). - Added support for
restartIdentity(PostgreSQL). - Added support for
withoutForeignKeyChecks(MySQL/MariaDB/SQLite).
- Added support for
- IMPROVEMENT: Optimized
QueryEngineto resolve transactions from the currentZoneif not explicitly provided. - IMPROVEMENT: Updated
feature-list.mdto track Transaction implementation status. - FIX: Resolved setup race condition in
include_test.dartby ensuring tables are synced before truncation.
0.1.5 #
- FEAT: Added support for
ENUMdata types with custom parsing and code generation. - FEAT: Introduced
@EnumPrefixannotation for configuring enum name generation. - FEAT: Added
EnumDataTypeclass to handle list of values and type safety. - CHORE: Centralized and improved data type definitions for better extensibility.
- IMPROVEMENT: Updated documentation to recommend
dart run sequelize_orm_generator:generatefor faster code generation. - FIX: Resolved list equality issues in enum types by adding
collectiondependency. - NOTICE: Revised SQLite support — Native drivers are no longer bundled; working on a build hook or script for downloading OS-specific drivers (manual configuration required).
0.1.4 #
- FEAT: Full SQLite dialect support — JSON path querying via monkey-patched
->/->>operators on the Sequelize v7 SQLite query generator. - FEAT: SQLite auto-database creation —
enableSqliteJsonSupport()patchesjsonOperations,jsonExtraction,jsonPathExtractionQuery, andformatUnquoteJsonat connect time. - FEAT: SQLite test infrastructure —
DB_TYPE=sqliteenvironment variable switches the test suite to SQLite with automatic test isolation (fresh database per suite). - FIX: Removed hardcoded
whereclause inQueryEngine.findOnethat was overriding user-provided queries. - REFACTOR: Extracted
buildJsonPathandenableSqliteJsonSupportfromconnect.tsintoutils/sqliteJsonSupport.ts. - REFACTOR: Extracted
cleanOptionsfromassociateModel.tsintoutils/cleanOptions.ts. - IMPROVEMENT: Test helpers —
isSqlite,isPostgres,isMysqlFamilyconvenience getters for dialect-aware test assertions. - IMPROVEMENT: Tests conditionally skip unsupported SQLite operations (TRUNCATE CASCADE, REGEXP, BIGINT precision).
- FIX: Created missing dartdoc category markdown files (
get-started.md,querying.md,models.md,associations.md) that were preventing documentation generation on pub.dev. - FIX: Escaped angle brackets in dartdoc comments to resolve
unintended_html_in_doc_commentlint warnings.
0.1.3 #
-
FEAT: Type-safe JSON querying via
JsonColumn<T>,JsonPath, andJsonTextclasses — fluent API for navigating and comparing JSON/JSONB columns. -
FEAT:
.key()for object property access,.at()for array index access,.unquote()for text extraction with string-specific operators. -
FEAT:
contains()operator for PostgreSQL JSONB containment checks (@>). -
FEAT:
normalizeJsonTypesconfiguration — automatically convertsJSON↔JSONBbased on the connected database dialect for cross-database portability. -
FIX:
save()no longer sends association keys to the bridge, preventing FK constraint violations when saving instances with eagerly-loaded associations. -
FIX: PostgreSQL
TRUNCATE CASCADEnow executes correctly via raw SQL fallback whenModel.truncate({cascade: true})doesn't cascade properly in Sequelize v7. -
FIX: Non-PostgreSQL dialects no longer receive a
publicschema default, preventingUnknown database 'public'errors on MySQL/MariaDB. -
IMPROVEMENT:
$contains,$contained, and$overlapoperators mapped in the query converter for JSONB queries. -
FEAT:
SequelizeBigInttype for BIGINT columns — wraps the string value with.toBigInt(),.toInt(), and.toJson()helpers. -
FEAT: Colored
ModelParseExceptionforfromJsonfailures — shows field, model, operation, types, and row index in a single line. -
FEAT: Strict type-safe parse helpers for all supported data types.
-
FEAT: JS bridge support for
TINYINT,SMALLINT,MEDIUMINT,CHAR, andBLOB. -
FEAT: Customizable
DataType.JSON/DataType.JSONBwithtype:parameter for specifying the Dart deserialization type (e.g.List<String>,Map<String, int>). -
FEAT: Generic
parseJsonList<T>andparseJsonMap<T>helpers with automaticjsonDecodefallback for bridge string payloads. -
IMPROVEMENT: Datatype options (length, scale, UNSIGNED, ZEROFILL, BINARY, variant) now forwarded to the JS bridge.
0.1.1 #
- FIX: migrate model identity usage from
nametomodelNameacross runtime model APIs to avoid clashes with columns namedname. - FIX: keep backward compatibility by deprecating
Model.nameand forwarding it tomodelName. - FIX: update Sequelize registration/association flows to use
modelNameconsistently. - FIX: move bridge server bundle to package source path for runtime packaging consistency.
0.1.0 #
Initial beta release of sequelize_orm.
Highlights #
- Type-safe ORM for Dart powered by Sequelize (Node.js) via a JS bridge.
- Support for PostgreSQL, MySQL, and MariaDB (SQLite, MSSQL, DB2 have Dart API stubs).
Sequelize Instance #
createInstance(),authenticate(),initialize(),sync(),close().define(),addModels(),getModel().truncate(),destroyAll(),seed().- SQL helpers:
Sequelize.fn(),col(),literal(),cast(),attribute(),identifier(),random().
Models & Code Generation #
@Tableannotation with full model options (timestamps, paranoid, underscored, freezeTableName, schema, engine, charset, version, and more).- Generates
*Model,*Values,Create*,Update*,*Columns,*Query, and*IncludeHelperclasses per model. - Static methods:
findAll(),findOne(),create(),update(),destroy(),restore(),truncate(),count(),max(),min(),sum(),increment(),decrement(). - Instance methods:
save(),update(),destroy(),restore(),reload(),increment(),decrement(),toJson().
Associations #
@HasOne,@HasMany,@BelongsToannotations with foreignKey, as, sourceKey, targetKey.- Eager loading via type-safe
IncludeBuilderwith nested includes, where, attributes, order, limit, separate, required, right join, and more. - BelongsTo mixin methods:
getX(),setX(),createX().
Operators #
- Logical:
and(),or(),not(). - Comparison:
eq(),ne(),gt(),gte(),lt(),lte(),between(),notBetween(),in_(),notIn(). - IS:
isNull(),isNotNull(),isTrue(),isFalse(),isNotTrue(),isNotFalse(). - String:
like(),notLike(),iLike(),notILike(),startsWith(),endsWith(),substring(). - Regex:
regexp(),notRegexp(),iRegexp(),notIRegexp(). - Misc:
col(),match(),all(),any().
Data Types #
- Integer:
TINYINT,SMALLINT,MEDIUMINT,INTEGER,BIGINT(with UNSIGNED, ZEROFILL). - Decimal:
FLOAT,DOUBLE,DECIMAL. - String:
STRING,CHAR,TEXT(with variants). - Other:
BOOLEAN,DATE,DATEONLY,UUID,JSON,JSONB,BLOB.
Attribute Annotations #
@PrimaryKey,@AutoIncrement,@AllowNull,@NotNull,@ColumnName,@Default,@Comment,@Unique,@Index.- Validation:
@IsEmail,@IsUrl,@IsIP,@IsAlpha,@IsNumeric,@Len,@Min,@Max,@IsUUID,@IsIn, and more.
Paranoid (Soft Delete) #
- Full support for soft delete with
paranoid: true, customdeletedAtcolumn, force delete, and restore.
Connection #
- Pool configuration (max, min, idle, acquire, evict).
- Full SSL/TLS support.
- Dialect-specific options for PostgreSQL, MySQL, MariaDB, SQLite, MSSQL, and DB2.
Seeding #
sequelize.seed()with type-safeSequelizeSeedingbase class, ordering, and sync modes.