sequelize_orm 0.1.0
sequelize_orm: ^0.1.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.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.