Minor Changes
-
BREAKING CHANGE: Rename adapter operation contracts and fields.
AdapterStatementbecomesDataManipulationOperation, andstatementbecomesoperation.Add separate adapter execution methods for DML and migration/DDL operations:
executeforDataManipulationOperationrequests andmigrateforDataMigrationOperationrequests.Add adapter introspection methods with optional transaction context:
hasTable(table, transaction?)andhasColumn(table, column, transaction?). -
BREAKING CHANGE: Replace the public
QueryBuilderAPI withQueryobjects that can be created withquery(table)and executed withdb.exec(...).db.query(table)still provides the same chainable ergonomics, but it now returns the publicQueryclass in a database-bound form instead of a separateQueryBuildertype.db.exec(...)now accepts only raw SQL orQueryvalues, and unbound terminal methods likefirst(),count(),exists(),insert(),update(), anddelete()returnQueryobjects instead of separate command descriptor types.The incidental
QueryMethodtype export has also been removed; useDatabase['query']orQueryForTable<table>when you need that type shape. -
BREAKING CHANGE: Remove the
@remix-run/data-table/sqlexport. ImportSqlStatement,sql, andrawSqlfrom@remix-run/data-tableinstead.@remix-run/data-table/sql-helpersremains available as the adapter-facing SQL helper module. -
BREAKING CHANGE: Rename the top-level table-definition helper from
createTable(...)totable(...)and switch column definitions tocolumn(...)builders. Runtime validation is now optional and table-scoped viavalidate({ operation, tableName, value }).Remove
~standardtable-schema compatibility andgetTableValidationSchemas(...), and stop runtime validation/coercion for predicate values. -
@remix-run/data-tablenow exportsDatabaseas the runtime class instead of separating the runtime implementation from a structuralDatabasetype. You can construct databases directly withnew Database(adapter, options)or keep usingcreateDatabase(adapter, options), which now delegates to the class constructor. -
Add a first-class migration system under
remix/data-table/migrationswith:createMigration(...)and timestamp-based migration loading- chainable
columnbuilders plus schema APIs for create, alter, drop, and index work createMigrationRunner(adapter, migrations)forup,down,status, anddryRun- migration journaling, checksum tracking, and optional Node loading from
remix/data-table/migrations/node
Migration callbacks now use split handles:
{ db, schema }.dbis the immediate data runtime (query/create/update/delete/exec/transaction)schemaowns migration operations likecreateTable,alterTable,plan, and introspection
Migration-time DDL, DML, and introspection now share the same transaction token when migration transactions are enabled. In
dryRun, schema introspection (schema.hasTable/schema.hasColumn) reads live adapter/database state and does not simulate pending dry-run operations.Add public subpath exports for migrations, Node migration loading, SQL helpers, operators, and SQL builders. SQL compilation stays adapter-owned, while shared SQL compiler helpers remain available from
remix/data-table/sql-helpers.@remix-run/data-table/migrationsno longer exports a separateDatabasetype alias. Migration callbacks still receivecontext.dbas the mainDatabaseruntime, so if you need the type directly, importDatabasefrom@remix-run/data-tableinstead. -
Add optional table lifecycle callbacks for write/delete/read flows:
beforeWrite,afterWrite,beforeDelete,afterDelete, andafterRead.Add
fail(...)as a helper for returning structured validation/lifecycle issues fromvalidate(...),beforeWrite(...), andbeforeDelete(...).