basalt 0.0.2
basalt: ^0.0.2 copied to clipboard
A type-safe, migration-first ORM for Dart: a compile-time-checked query builder, code-generated row mappers, and pluggable SQL backends.
Changelog #
0.0.2 #
Single-statement batch writes.
updateAll(table).keyedBy(col).values([...])— a newUpdateAllStatementthat updates many rows with per-row values in one statement (WITH ... AS (VALUES ...) UPDATE ... FROM), with composite keys (repeatedkeyedBy), an optional extra.where(...), andRETURNINGsupport (columns are table-qualified there to stay unambiguous next to theVALUEStable).SqlDialect.castType(SqlType)— new dialect seam naming the native type toCASTa bound parameter to where SQL gives the server no inference context (theVALUEStable ofupdateAll); dialects that don't need casts returnnull.ColumnValuenow carries the column'sSqlType(set byTableColumn.set) so serialization can emit those casts.- A zero-row
INSERT(no.value(...)/.values(...)) now throwsStateErrorat build time instead of emitting invalid SQL. @Insertabledoc updated for the new generated batch extension (seebasalt_codegen0.0.2).
0.0.1 #
Initial development release of the basalt_dart core.
- Type system:
SqlType<T>codecs (IntSqlType/StringSqlType/DoubleSqlType/BooleanSqlType/BlobSqlType/DateTimeSqlType) with a singleNullableSqlType(...)wrapper for nullable columns. - Schema: sealed
TableColumn<T, Tbl>(ValueColumn/PrimaryKey/Ref),TableRef,QuerySource,TableAliasfor self-joins. - Expressions with phantom table scope;
eq/ne/gt/ge/lt/le/isIn/between/isNull/like/eqColumn, operator sugar, and&/|combinators. - Query builder:
from().where().orderBy().limit().offset().select().innerJoin()/leftJoin().map()→MappedQuery;RowReader(read by column name) and reusableRowMapper. - Writes:
insertInto/update/deleteFromwithTableColumn.set. - Serializer (
QueryBuilder+SqlDialect) with two-tier join scope validation. - Async-first
Connectioninterface with transactions (nested → SAVEPOINT) andintrospect(). - Annotations for codegen:
@Queryable,@Insertable,@AsChangeset,@Column(readOnly/writeOnly),@Relation.