Repository navigation
Add db:create and db:drop, columnAliasPrefix, a custom paginator page name, and fixes for migrations, transactions and schema:generate
Latest
Immutable
release. Only release title and notes can be modified.
22.5.0 (2026-11-19)
Features
node ace db:createandnode ace db:dropcreate and drop the database of a connection. (#1183)- A model can set
static columnAliasPrefixto use in place of the table name in the aliases of its columns. Set it when a real column of the model has the name of the alias of another column, for exampleurlandsemafor_urlon the tablesemafor. (#1214, closes #1191) paginate()accepts the name of the page query string parameter as its third argument, for examplepaginate(page, 20, 'p'). (#1162)- Each
make:*command accepts--forceto overwrite an existing file.make:modelgives the flag to the files that it makes with the model. (75178c1) Adapter.dbisprotected, andSeedsRunneris exported, to extend Lucid, for example for multi-tenancy. (#1171)
Bug fixes
- The migration runner takes and releases its advisory lock on one database session, and runs each migration on that session. Before, two runners could apply the same migration when the session of the lock ended. (#1215, closes #1153)
schema:generatenames the class of a table in another schema after its schema when two tables have the same name, for exampleAppOrderSchemaforapp.orders. When a class name still collides, it fails, names the tables and writes no file.tablesof the schema rules accepts<schema>.<table>. (#1216, closes #1195)schema:generatesetscolumnNamewhen the property name does not give back the column name, for exampleplayer1_id. (b23d814, closes #1173)db.transaction({ isolationLevel })runs a manual transaction at that isolation level. Before, the option was ignored. Underrepeatable readorserializable, your code can now get serialization failures to retry. (#1203, closes #1202)- Preloads inside a transaction run their queries one after the other, so PostgreSQL no longer gives the query queue deprecation warning. (#1200, closes #1199)
- A row with a
nulllocal key has no related rows in a preload. Before, it made the preload of the whole collection fail. (#1189, closes #1188) update(values, returning)with an object resolves the column names and the raw values. (#1201)toKnex()andtoSQL()of a relationship subquery keep its constraints. (#1208, closes #1207 and #1209)$columnsis no longer a key ofModelAttributes, sofill(),merge()andcreate()do not accept it. (#1176, closes #1175)- The alias of
--transformerofmake:modelis-t. Before,-cwas the alias of--controllerand of--transformer, so-cmade a transformer. (#1180)
Performance
- A preload matches the related rows to their parents in one pass. A preload of 2,000 users with 22,000 pivot rows went from 4.2 s to 0.1 s. (#1187, closes #1185)
What's Changed
- feat: expose Adapter db attribute and export SeedsRunner by @nedois in #1171
- fix: exclude $columns from ModelAttributes inferred type by @ad-momo in #1176
- feat(paginator): add custom page name by @FlorianV85 in #1162
- fix: change alias for transformer flag from 'c' to 't' by @McSneaky in #1180
- feat: add db:create and db:drop commands by @batosai in #1183
- fix: treat a null local key as no related rows across all relation types by @evoactivity in #1189
- fix: prevent where clause loss for toKnex and toSQL by @dunhamjared in #1208
- fix: forward isolation level options to manual transactions by @KevinBlakeLopez in #1203
- fix: resolve keys and raw values when updating an object with returning columns by @suguid in #1201
New Contributors
- @nedois, @ad-momo, @FlorianV85, @batosai, @evoactivity, @dunhamjared, @KevinBlakeLopez and @suguid made their first contribution.
Full Changelog: v22.4.2...v22.5.0