Changelog
The nestjs-drizzle-crud changelog, every release since 3.0.0 with what was added, changed, fixed and deprecated, newest first, mirroring CHANGELOG.md.
The nestjs-drizzle-crud changelog lists every release since 3.0.0, newest first, with what each one added, changed, fixed and deprecated. It mirrors the CHANGELOG.md shipped in the npm package, follows Keep a Changelog, and the package uses Semantic Versioning: a patch fixes, a minor adds, and only a major breaks the public API.
Read the Changed section before you upgrade
Each release's Changed list holds the behaviour or type changes existing code may rely on. Feature pages describe current behaviour and this page is the history, so if the two disagree, the feature page wins and the changelog entry is the bug.
The 3.0.x line is PostgreSQL-first. MySQL-specific paths (non-RETURNING restore, ER_DUP_ENTRY mapping, dialect locking) are tracked separately and unchanged in those entries.
3.3.1, 3.4.0, 3.5.0 and 3.5.2 were tagged but never published to npm. Their changes reached npm
in 3.5.1 (3.3.1 to 3.5.0) and 3.6.0 (3.5.2). The unscoped nestjs-drizzle-crud stops at 3.3.0.
[3.8.3] - 2026-11-16
Docs and package metadata only. The runtime code is the same as 3.8.2.
Docs
- The docs moved to avytrix.dev/opensource/nestjs-drizzle-crud.
The old docs subdomain is gone and does not redirect, so update any bookmark or link that still
points at it. The package
homepage, both READMEs,AGENT.mdand the repository guides link to the new address. - The docs site is built with the
/opensource/nestjs-drizzle-crudbase path and published by avytrix.dev. This repo no longer deploys it; its docs workflow builds the site and runs the SEO gate on every pull request instead.
[3.8.2] - 2026-11-04
Fixes from the 3.8.1 audit (G-01 to G-08). The tenant key check now lets the database compare keys, so it follows each column's collation, and a malformed key or an ISO date string in a write body is no longer a 500. No public API or override point changed, and no operation sends more statements than in 3.8.1.
Changed
- The tenant key check,
attachandsyncleave the key comparison to the database. They join the keys they were sent, as an inlineVALUESlist, against the related table in the same scopedSELECT, so the column's type and collation decide which key matched. Acitextor SQLiteNOCASEkey of the caller's own tenant in another case is accepted again (3.8.1 refused it with a 400), and on MySQL a key under a_bincollation that differs from another tenant's only in case is refused. PostgreSQLtextstill compares exactly, and a uuid matches in any case. On MySQL an integer or decimal key is compared in its column's type, so aBIGINTpast 2^53 is matched exactly.attachandsynclink each target by its key as stored, so"ann@x.io"and"Ann@X.io"on acitextcolumn give one link. massUpdateandmassUpsertloadrelationsandcountsinside their transaction when a value holds a Drizzlesqlexpression. A load that fails then rolls the write back, so a retry no longer addsviews + 1twice.- A
RangeErrorthrown while a statement's values are mapped (a custom type's own check, say) is no longer reported as "Too many values in one statement". Only the call stack overflow of an oversized parameter list is.
Fixed
- A belongs-to key the column's type cannot hold (
"nope"for a uuid) is a 400 inmassCreate,massUpdateandmassUpsert, and inupdateinside a caller's transaction. It was a raw22P02or25P02, a 500. - Every write (
create,update,upsert, the mass writes and nested rows) turns an ISO date string or a number for a date-modetimestamp,dateordatetimecolumn into aDate, as filters already did. It was a 500TypeError(value.toISOString is not a function). A value that is not a date, an Invalid Date included, is a 400 that names the column, in a write and in a filter. massUpdategroups SETs by their raw values: a hook that returnsnullfor one id and an Invalid Date for another no longer gets both into oneUPDATE. ADateand its ISO string are two values, and byte arrays compare by their bytes.- A
massUpdatewhose SETs all hold the samesqlexpression object, as inmassUpdate(ids, { n: sql`n + 1` }), sends oneUPDATEinstead of one per id. - The per-call scope memo ends with the public call that started it. Options a hook kept and passed to a later call reused the old memo, which grew with each call and resolved a context object mutated in place to its old tenant.
Docs
- The 3.8.1 entry now says the 404 ahead of a refused value holds outside a caller's transaction,
and that a mass write with an SQL value was not safe to retry. The bulk operations page says when
such a write loads its relations and that one shared
sqlobject is oneUPDATE. - The multi-tenancy page says the database compares the keys. The CRUD operations page, the README
and
AGENT.mdsay date strings are parsed on writes.
[3.8.1] - 2026-11-04
Fixes from the 3.8.0 audit (D-01 to D-11). Three of them close gaps in tenant isolation: a scope handed from one service to another, a batch key that differs from another tenant's only in case, and nested children that skipped the key check. No public API or override point changed.
Changed
- Text keys compare exactly in the tenant key check,
attachandsync:"US"and"us"are two keys, as they are two rows on PostgreSQL and SQLite. Before, every key was lowercased, so a batch holding both could point a row at another tenant's"us"and get a 201 where"us"alone was a 400. A uuid column still ignores case, and so does MySQL, to follow its default collations, which match"us"to a stored"US"and cannot hold both as distinct keys. - On a scoped entity, a nested create checks the belongs-to keys of the rows it writes (a
belongs-to parent, has-many children, new many-to-many targets) against the caller's tenant,
using the nested relation's own
relations. A child key to another tenant's row is the same 400ForeignKeyViolationExceptionas a key to a missing row, and nothing is written. It was a 201. A child key that no nested relation declares is still left to the database's foreign key. massSoftDeleteandmassDeleteputdeleted_at IS NULLin theWHEREof their write, as the single-row writes have since 3.8.0. A row soft-deleted between the existence check and the write is a 404 entry and the batch writes nothing, instead of being stamped again or hard-deleted.massForceDeletestill removes a row in either state.massCreateloadsrelationsandcountsinside its transaction again. A load that fails rolls the rows back, so a retry no longer stores them twice. The other mass writes still load after the commit, where a retry gives the same rows, except for a write whose values hold an SQL expression (massUpdate(ids, { views: sql`views + 1` })), which 3.8.2 loads inside too.updateof a missing row with a value the database refuses (update(999, { views: "abc" })) is a 404, as it was before 3.8.0, instead of a 400, outside a caller's transaction. Inside one (options.transaction) the failed statement has aborted the transaction on PostgreSQL, so the answer stays the 400, which is the same for every tenant.
Fixed
- The per-call scope memo is keyed by service and by the context it was resolved for. Options
handed from one service to another, the natural way for a subclass override to share a
transaction, carried the first service's scope: a service whose scope is
nulllet a scoped one read every tenant's rows, and a second service scoped by another column storedNULLin it. Each service still runs its scope function once per call. - An override of
emitEventorprepareUpdatekeeps the guard read ahead of the write, like an override of abefore*hook. AnemitEventoverride saw the before event for another tenant's id before the 404. massUpdatewith abeforeUpdatehook that returnsNaNfor one id andnullfor another no longer writesNaNto both, and a Drizzlesqlexpression as a value (views + 1) works as it does inupdateinstead of failing with a circularTypeError(a 500).- The tenant key check sends its
SELECTs, one per relation, together instead of one after the other.
Docs
- The multi-tenancy FAQ answered "No" to "Are eager-loaded relations filtered by tenant?", against the section on the same page. It now says yes, when the related table has the scope columns. The multi-tenancy and relations-on-writes pages say which nested keys are checked, and the bulk operations page says when a mass write loads its relations.
AGENTS.md,CONTRIBUTING.mdandapps/docs/AGENTS.mdpoint at the changelog page where it lives now,(support)/changelog.mdx.
[3.8.0] - 2026-11-03
Performance fixes from the 3.7.1 performance report. Calls return the same rows, in the same
order, with the same errors, in fewer statements and shorter transactions. The one visible
difference is under Changed: a row soft-deleted between the guard read and the write is now a 404
instead of a write. Inside SqlBaseCrudService the six mass writes share one skeleton, and so
do softDelete, restore and delete; no public API, override point or message changed.
Added
- Full-text search takes a column that already is a
tsvector, such as a generated, stored column, and uses it as is instead of wrapping it into_tsvector, so a GIN index on the column servesfullTextSearch()andsearch.mode: "fullText". Before, such a column failed withfunction to_tsvector(unknown, tsvector) does not exist. Next to text columns it iscoalesce(col, ''::tsvector); text columns keep the 3.7.2 vector, bare for one column and coalesced for several. On 200,000 rows a search on the stored column with its index took 0.6 ms, against 600 to 900 ms computingto_tsvectorper row without one. The full-text page shows the index for each shape. - A docs page, Database indexes for fast Drizzle queries,
lists the index each query shape needs:
lower(col)(orcitext, orcaseSensitive: true) for the default case-insensitive equality, the sort columns plus the primary key for cursor pages, GIN for full-text search,pg_trgmforcontainsandsearch, foreign keys and both join table columns for relations, partial indexes ondeleted_at IS NULL, and the tenant column first. It says when to usewithCount: falseor the cursor on a large table. The filtering page now spells out thatfindOnecompares strings with a plain, case-sensitive=whilefindAllandcountuselower()by default (unchanged; a default change waits for a major), and the hooks page says where after hooks run: after the commit for a single write, inside the transaction for a mass write.
Changed
- A row soft-deleted between the guard read and the write is no longer written:
updateandsoftDeleteonly touch a live row,restoreonly a row in the trash, anddeleteno longer hard-deletes a row that was soft-deleted meanwhile (forceDeletestill does). Such a call is a 404 instead of a write, afalsereturn or a "Failed to update entity" error, and one whose row vanished with an expected version is a 404 instead of a 409.
Fixed
- Keyset pages seek instead of filtering.
findByCursoradds a bound on the first sort column (col <= $1descending,col >= $1ascending) ahead of the OR expansion, drops theIS NULLbranch for NOT NULL and primary key columns (nullable and relation columns keep it), and on PostgreSQL compares(a, id) > ($1, $2)as one row value when every column is NOT NULL and sorts the same way. With an index on the sort columns and the primary key, page 9,000 of 200,000 rows went from 24.4 ms to 0.6 ms (created_atdescending) and from 50.3 ms to 0.5 ms (viewsascending) on PGlite. A sort column the row already carries is no longer selected a second time for the cursor. Pages, their order and cursors are unchanged. - Single-row writes skip the read first. On PostgreSQL and SQLite,
update,softDelete,restore,deleteandforceDeletesend one statement whoseWHEREholds the whole guard (primary key, tenant scope, expected version, soft delete state) and read the row only when nothing came back, to answer with the same 404 or 409 as before. The read still runs first when something a caller can observe sits between it and the write (an overriddenbefore*hook,validateUpdateormapUpdateDtoToEntity, or a before event), so hooks and events see exactly what they saw before, and on MySQL. A missing row is still a 404 ahead of a bad body. - Mass writes send no savepoint on the happy path when they open their own transaction:
massUpdate,massSoftDelete,massRestoreandmassDeletetake 4 round trips instead of 8 (BEGIN,SELECT, the set statement,COMMIT),massCreateandmassUpsert3 instead of 5. When the set statement fails, the transaction rolls back and the items are replayed in a fresh transaction that is rolled back too, soBulkOperationExceptionnames the same items with the same statuses and messages. Inside a caller's transaction, or once a before event handed the transaction to a subscriber, the savepoints stay, so a failed item does not abort the caller's PostgreSQL transaction. massUpdatesends oneUPDATEper distinct SET whenbeforeUpdatereturns different data per id, instead of oneUPDATEand a savepoint pair per id: a hook with two results over 50 ids is 5 round trips instead of 155. Rows still come back in the input order, after hooks run in that order, and a failure still names every failing id.- On MySQL,
massCreateof rows with auto-increment keys reads the inserted rows back with oneSELECT ... WHERE id IN (...)instead of one per row. The inserts stay one per row: MySQL only reports the first id of a multi-rowINSERT, and InnoDB does not promise the others are consecutive. - Relation loaders and relation counts split a parent key list that would not fit in one
statement.
loadBelongsTo,loadHasMany,loadManyToManyandloadCountssend the keys in chunks of 64,535 on PostgreSQL and MySQL, 31,766 on SQLite and 90 on Cloudflare D1, one query per chunk, so a nested page whose level holds 70,000 keys loads in two queries instead of failing with a 400 (3.7.2) or a 500 (before). Below that, it is one query per relation as before. The chunk size is the new protectedrelationChunkSize(db). - Fewer statements in a few calls.
exists(id, options)is oneSELECTand no longer loadsoptions.relationsoroptions.countsit throws away (4 statements to 1 with two relations and a count); they are still checked against the allowlists. A nested create skips the "already linked?" read for its many-to-many ids.attach,syncanddetachread the row once and load the relation onto it, instead of reading it before and after (8, 9 and 6 round trips to 7, 8 and 5). A mass write that opened its own transaction loadsoptions.relationsandoptions.countsafter it commits, so it holds its row locks for less time; with a count filter, or in a caller's transaction, they still load inside. The returned rows are the same. - A
scopefunction runs once per call instead of once per statement and relation: 5 times for afindAllwith three relations and a count, 7 for amassUpdate, now 1 each.
[3.7.2] - 2026-11-03
Fixes from the 3.7.1 audit. The batch limit now counts the statement the database receives.
Changed
- The bound parameter limit is checked per statement, against the database's own limit:
65,535 on PostgreSQL and MySQL, 32,766 on SQLite and libSQL, 100 on Cloudflare D1. The service
counts the parameters of every statement as Drizzle builds it, so two OR'd
INlists, the version checks of amassUpdatewithexpectedVersions, the children of a nested create and the targets ofattachandsyncall count, and a statement past the limit is a 400 that names its count and the limit before it runs. Before, each input list was checked against 60,000 on its own: some of those calls still ended in a 500, amassCreatethat would have fit on PostgreSQL was refused (it counted four extra values per row), and on SQLite the cap sat above the database's limit. The message changes from "Too many values in one call (n); the limit is 60000" to "Too many values in one statement: n bound parameters, and PostgreSQL takes at most 65535".bindLimit(db)is protected, for a server built with another limit.MAX_BATCH_PARAMETERS,assertBatchSizeandinsertParametersstay for compatibility but are deprecated and no longer used. - On a scoped entity,
create,update,upsertand the mass writes check every belongs-to key they set against the caller's tenant when the related table has the scope columns, the wayattachchecks its targets: oneSELECTper relation for the whole call. A key to another tenant's row is the same 400ForeignKeyViolationExceptionas a key to a missing row, so the answer no longer tells them apart, and a missing row is refused even without a database foreign key. Calls withskipScope: trueand related tables without the scope columns are not checked. - On SQLite,
contains,startsWithandendsWithwithsql.caseSensitive: truecompile toGLOBand match case exactly. They usedLIKE, which ignores ASCII case. The default (case-insensitive) and thelikeoperator are unchanged. - On MySQL,
connection.idleTimeoutalso sets mysql2'smaxIdleto one below the pool size. mysql2 only reaps idle connections whenmaxIdleis belowconnectionLimit, so the timeout had no effect before. forRootAsyncwith more than one ofuseFactory,useClassanduseExistingthrows at startup and names them. Before,useFactorywon and the class was ignored.
Fixed
- On SQLite, a
STRICTtable refusing a value of the wrong type (extended code 3091, which libSQL reports asUNKNOWN_SQLITE_ERROR_3091) andSQLITE_MISMATCH("abc"for anINTEGER PRIMARY KEY) are a 400ValidationFailedException, not a 500. The dialect contract checks the same mapping on every dialect. - Filters inside
options.countsget the same 32 level depth cap as afindAllfilter. A very deep one was a 500 (stack overflow). - The filter depth check no longer overflows the call stack on an
INlist of a few hundred thousand items. - A batch so large that Drizzle's own SQL builder overflows the call stack is the same 400 as any other statement past the limit.
- Full-text search over several columns no longer drops rows that have
NULLin one of them. The vector wasto_tsvector(cfg, a) || to_tsvector(cfg, b), andx || NULLisNULL, so such a row never matched, infullTextSearch()and insearch.mode: "fullText"alike. Each column is now wrapped incoalesce(column, '')when there is more than one. A GIN index on the old multi-column expression no longer matches the query; recreate it with thecoalesce(the full-text search page has the exactCREATE INDEX). A single column is unchanged.
Docs
AGENTS.mdnames the package@avytrix/nestjs-drizzle-crud, and says that PGlite, the engine of the unit and e2e specs, returns no rows above 32,767 bound parameters.
[3.7.1] - 2026-11-02
Fixed
- The error for an upsert on a scoped entity on MySQL now reads "upsert on a scoped entity needs PostgreSQL or SQLite". It said PostgreSQL only, though SQLite supports a scoped upsert since 3.7.0.
?fields=paths named__proto__,constructororprototypeare treated as plain names. Before, they reached the select tree's object internals (CodeQL js/remote-property-injection).
[3.7.0] - 2026-11-02
SQLite support, MySQL connections built for you, and full-text search that works like findAll.
Added
dialect: "sqlite"for SQLite, libSQL (Turso) and Cloudflare D1. Pass the Drizzle instance asdb. Writes useRETURNING,upsertusesON CONFLICT DO UPDATEwith the tenant guard, and keyset pages follow SQLite's NULL order.LIKEgetsESCAPE '\', so%,_and\in a search term match literally. Constraint errors map like the other dialects:UNIQUE409,FOREIGN KEY400 on a write and 409 on a delete,NOT NULLandCHECK400. Full-text search, row locks and the array and JSON operators are a 400.- On Cloudflare D1 and synchronous SQLite drivers (better-sqlite3, bun:sqlite, sql.js), the calls
that need an interactive transaction (mass writes, nested creates,
attach,detach,sync) throw aTransactionExceptionthat says why, before any statement runs.TransactionExceptionis no longer deprecated. connectionStringworks withdialect: "mysql": the module builds amysql2pool, wraps it withdrizzle-orm/mysql2and ends it on shutdown.mysql2is a new optional peer, loaded only on that path.connection: { poolSize, idleTimeout, ssl }for the connection the module builds fromconnectionString, on PostgreSQL (postgres-js) and MySQL (mysql2).forRootAsynctakesuseClassanduseExisting, with a class that implementsDrizzleCrudOptionsFactory(createDrizzleCrudOptions()), next touseFactory.fullTextSearch()takesoptions.filters, and honoursoptions.relations,options.selectandoptions.counts, the same asfindAll. Before, they were ignored.language(the text search configuration, default"english") andqueryMode("plain", the default, or"websearch"forwebsearch_to_tsquery) onfullTextSearch()options and onsearchwithmode: "fullText". A language that is not a plain identifier is a 400.- New types:
DrizzleConnectionOptions,DrizzleCrudAsyncOptions,DrizzleCrudOptionsFactory,FullTextOptions,FullTextQueryModeandFullTextSearchOptions.
Fixed
- MySQL:
lockandforNoKeyUpdateaddFOR UPDATEorFOR SHARE(forNoKeyUpdatebecomesFOR UPDATE). They used to be accepted and silently ignored. - MySQL strict mode data errors (a missing required value, a value too long, out of range, of the wrong type, a bad date, a failed check) are a 400 that names the column, instead of a 500.
Changed
- The default
sql.useReturningistruefor every dialect except MySQL, so SQLite gets it. PostgreSQL and MySQL keep the values they had.
[3.6.0] - 2026-11-02
Fixes from the second audit. The first one is a security fix: upgrade if you use scope.
Security
- Related tables now follow the tenant scope. Loaded relations, the joins behind relation columns,
relation filters (
some,none,everyand nested columns) andcountsonly see related rows of the caller's tenant when the related table has the scope columns. Before, a row pointing at another tenant's row (a plain foreign key allows it) loaded that row, and a filter on it answered questions about it.
Added
createCrudControllertakesvalidation, the validator options for the bulk bodies. Pass the same options as your globalValidationPipe.
Fixed
PATCH /bulkvalidatesdataagainstdto.update, the check a singlePATCHalready had.- Route decorators that wrap the handler now run. Before, the factory dropped the wrapped handler.
- Bulk ids are parsed like
:id, so a bad id is a 400 before any statement runs. - A filter nested deeper than 32 objects is a 400. A thousand nested
notgroups used to overflow the stack and answer with a 500. - A batch past the bound-parameter limit (60,000 values: rows times columns for
massCreateandmassUpsert, ids for the id based methods, values in anINfilter) is a 400 that names the limit, instead of a driver protocol error and a 500. - A missing required value (
23502) is a 400 that names the column. - MySQL
ER_DUP_ENTRYis a 409, and foreign key errors are a 400 on a write and a 409 on a delete. upsertno longer updates a row in the trash: the conflict writes nothing and is a 404.- With
useReturning: false, a scopedupsertno longer reads back another tenant's row. restoreon a live row is a 404 before any hook or event runs. It used to succeed and bumpupdated_atand the version.?relation[some]=and[none]=with no column need the relation, or one of its columns, infilterableColumns.- A nested child row cannot set its own generated primary key.
[3.5.2] - 2026-11-02
Fixed
softDelete,restore,massSoftDeleteandmassRestoreon an entity without soft delete, and full-text search on MySQL (fullTextSearch()orsearch.mode: "fullText"), now throw aBadRequestException. They were a plainError, which reached the client as a 500.options.countsnow applies the tenant scope to the related rows it counts, when the related table has the scope column. Before, a parent's count included rows of other tenants.
Changed
sortOrdernow defaults to"asc"infindAllandfindByCursor, so a baresortBy: "name"sorts the same way as?sortBy=nameover HTTP. PasssortOrder: "desc"to keep the old order.
[3.5.1] - 2026-11-02
Changed
-
The package is now published as
@avytrix/nestjs-drizzle-crud. The code is the same as 3.5.0. Update the dependency and the imports:pnpm remove nestjs-drizzle-crud && pnpm add @avytrix/nestjs-drizzle-crudimport { CrudService } from "@avytrix/nestjs-drizzle-crud";The MCP server runs with
npx -p @avytrix/nestjs-drizzle-crud nestjs-drizzle-crud-mcp. The unscopednestjs-drizzle-crudpackage is deprecated and gets no new releases.
[3.5.0] - 2026-11-02
The P2 features from the November 2026 audit (M10 to M18). Each one is covered by specs that run real
SQL against PGlite (test/pglite.integration.spec.ts), and the controller factory, scoping,
locking, OpenAPI document, counts and quantified filters also run over real HTTP in the example
app.
Added
- Relations on writes.
create,update,upsert,restoreand every mass write takeoptions.relationsandoptions.countsand return the rows with them loaded, through the same batched loaders as a read: one query per relation for the whole batch. Ten rows frommassCreatewithrelations: ['author']cost oneINSERTand oneSELECT. - Nested create. With a relation listed in the new
writableRelationsallowlist, a create body can carry it: an array for a has-many (one multi-rowINSERT), an object for a belongs-to (inserted first, its key set on the row), and ids or objects for a many-to-many (new targets in oneINSERT, links in one more). Everything runs in one transaction and needsRETURNING. attach,detachandsyncfor many-to-many relations:attach(id, 'tags', [1, 2]). Set based (a fixed number of statements whatever the number of ids), already-linked ids are skipped, and an unknown or soft-deleted target is a 400 with a 404 entry per id. Each returns the row with the relation loaded.createCrudController(Service, options), a controller factory. It registers list (offset, or keyset with?cursor=), trash, get, create, update, delete, soft delete, restore and four bulk routes, all throughparseQuery. The:idparam is parsed from the primary key column (ParseIntPipe for an integer, ParseUUIDPipe for a uuid) unlessidTypesays otherwise. Routes can be turned on or off one by one and take their own decorators, so guards and roles fit in. Bulk routes are off by default.service.parseId(raw)andservice.idKind()are public.- OpenAPI for list queries.
@ApiCrudQuery(source)documentspage,limit,sortBy,sortOrder,cursor,count,withCount,search,fields,with,counts, the trash flags and one parameter per filterable column with its type.@ApiCrudList(source)adds the page envelope with a row schema built from the table.@nestjs/swaggeris an optional peer, loaded only when one of these decorators runs. - Tenant and ownership scoping.
scope: (ctx) => ({ tenant_id: ctx.tenantId })(or a fixed object) is ANDed into every read, count, cursor page,countBy,fullTextSearch, relation count, write, bulk write, upsert, soft delete, restore, force delete and attach/detach/sync, and written onto every row a create or upsert inserts (and onto nested child rows that have the column). Another tenant's id is a 404 everywhere. The context comes fromoptions.contextor fromCrudContext.run(...)/CrudContext.middleware(...), which keep it inAsyncLocalStoragefor the request. A missing context value fails closed withMissingScopeException(403); a resolver that returnsnull, orskipScope: true, runs unscoped on purpose. - Module-level events.
hooks.enableGlobalHooks: truenow does what it says: every service raises a before and an after event on the injectableCrudEventBusfor each write, bulk and upsert included. Subscribe withhooks.subscribersinforRootor by injecting the bus. A bulk call raises one event withbulk: trueand every id, so audit trails and cache busting stay set based. A before listener that throws stops the write; an after listener that throws inside a transaction rolls it back.skipEvents: trueopts a call out. - Optimistic locking.
versionColumn: 'version'starts rows at 1 and adds one on every update, soft delete, restore, upsert conflict and bulk write. An update, soft delete, restore or delete that names a stale version (options.expectedVersion, or the version key in an update body) is a 409StaleVersionException. Mass writes takeexpectedVersions: { [id]: version }and report a 409 entry per stale id. - Relation counts and grouped counts.
options.counts: ['posts'](or{ posts: { status: 'published' } }) puts_count: { posts: 3 }on every row offind,findOne,findAll,findByCursorand the writes above, with oneGROUP BYquery per relation for the whole result. Soft-deleted related rows are not counted.countBy(column, filters)returns[{ value, count }], largest group first, for a column of the table or of a top-level belongs-to. withCount: falseonfindAll(and?withCount=falsein the parser) skips theCOUNT(*). The envelope then hastotal: nulland ahasMoreflag, from fetching one row past the page.- Deeper relation filters. A relation filter can go on through the related table's own
relations at any depth:
{ state: { country: { code: 'IN' } } }, or?state[country][code]=IN. Below the first joined belongs-to, each level is anEXISTSsubquery. Collections takesome,noneandevery({ posts: { none: { status: 'draft' } } }), compiled toIN/NOT EXISTSsubqueries that never multiply rows, insideor/and/notgroups and incount. - New exports:
createCrudController,CrudContext,CrudEventBus,ApiCrudQuery,ApiCrudList,MissingScopeException,StaleVersionException, and the typesCrudControllerOptions,CrudControllerInstance,CrudRouteName,CrudRouteOptions,CrudEvent,CrudEventPhase,CrudSubscriber,CrudWriteOperation,CrudScope,CrudScopeValues,CrudContextValue,CollectionFilter,CollectionQuantifier,CountByRow,CrudPage,UncountedCrudPage,RelationCounts,ApiCrudSourceandApiCrudQueryOptions. New config keys:scope,versionColumn,events,writableRelations. New options:counts,context,skipScope,skipEvents,expectedVersion,expectedVersions, andPaginationOptions.withCount.
Changed
These change behaviour or types that existing code may rely on. Check each one before upgrading.
findAllis overloaded onwithCount. With a literalwithCount: falseit returnsUncountedCrudPage<T>(total: null), without oneCrudPage<T>(total: number), and with awithCounttyped asboolean(whichParsedCrudQuery.paginationis)totalisnumber | null. Code that passesq.paginationfromparseQuerystraight tofindAlland then does arithmetic ontotalneeds atotal !== nullcheck. The runtime result is unchanged unlesswithCount: falseis passed.withCountandcountsare reserved query parameters. The parser no longer treats them as filters. A column with one of those names can still be filtered from code.- Writes read
options.relationsandoptions.counts. They used to be ignored oncreate,update,upsertand the mass writes. They are now checked against the allowlists (withselectandsearch) before anything is written, and loaded onto the result. - A relation filter can name a relation of the related table, and a collection filter whose
keys are all
some,noneoreveryis a quantifier. Both used to be a 400 ("Unknown filter column"). A related table that really has a column calledsome,noneoreverykeeps the old meaning. DRIZZLE_CRUD_CONFIG.hookscarries onlyenableGlobalHooks(a boolean);subscribersstay on the raw config.
Fixed
hooks.enableGlobalHooksdid nothing (BUG-21). It now wires the module'sCrudEventBusinto every service.
Deprecated
- Nothing new.
hooks.enableGlobalHooks, deprecated as a no-op in 3.3.1, is no longer deprecated.
[3.4.0] - 2026-11-02
The P1 features from the November 2026 audit. Every one is covered by specs that run real SQL
against PGlite (test/pglite.integration.spec.ts) and by e2e specs over real HTTP in the example
app.
Added
- A query string parser.
service.parseQuery(query)and the standaloneparseCrudQuery(query, table, options)turn?age[gte]=18&status=active®ion[name]=Asia&or[0][code]=IN&sortBy=-name&page=2&limit=20&fields=id,name&with=region&search=jointo{ filters, pagination, options, isCursor }. Values are coerced by Drizzle column type: integers and other numbers tonumber,biginttobigint, booleans, dates toDate(an invalid one is a 400),numericchecked and kept as an exact string, and text, uuid and enum left as strings. An unknown column, relation, operator, sort column,fieldsentry orwithpath is a 400. It reads both Express 5's flatage[gte]keys andqsnested objects. - Per-entity allowlists.
filterableColumns,sortableColumns,selectableColumns,searchableColumnsandloadableRelationslimit what a caller may filter, sort, select, search and eager-load;writableColumnslimits what create, update and upsert may write. Anything outside a set list is a 400, in the service and in the parser. Unset lists allow everything.skipAllowlists: trueskips them for a trusted call, andfindOnewhere keys are not checked. - Trash view and purge.
withDeleted: trueandonlyDeleted: truework on every read (find,findOne,findAll,findByCursor,count,exists,fullTextSearch).forceDelete(id)andmassForceDelete(ids)hard-delete rows whether they are soft-deleted or not. - Upsert.
upsert(dto, { conflictTarget, update })andmassUpsert(rows, ...)insert or update in one statement:ON CONFLICT DO UPDATEon Postgres,ON DUPLICATE KEY UPDATEon MySQL. A clash on another unique key is a 409, bad input a 400, and the same key twice in onemassUpsert(21000) a 400. and,orandnotfilter groups.{ or: [{ status: 'a' }, { author: { name: 'Bob' } }], not: { tags: { name: 'x' } } }. Groups nest, hold column, relation and collection filters, work inside a relation filter, and apply tocount.- New filter operators.
notIn,between,startsWith,endsWithandcontains(escaped, case-insensitive unlesssql.caseSensitiveis on),iStartsWith,iEndsWithandiContains(always case-insensitive), and on PostgreSQLarrayContains,arrayOverlapsandjsonContains. A pattern operator on a non-text column, an array operator on a non-array column, or a PostgreSQL only operator on MySQL is a 400. - Keyset pagination.
findByCursor(filters, { cursor, limit, sortBy, count }, options)returns{ data, limit, nextCursor, total? }. The cursor is base64url JSON of the last row's sort values plus the primary key, so pages stay stable under inserts and, with an index on the sort columns (since 3.8.0), deep pages cost the same as the first. It works with every sort, filter, relation andselect, keeps timestamp microseconds and follows the database's NULL ordering. The count only runs withcount: true. A cursor that is not valid, or was made for another sort, is a 400. - Multi-column and relation sorts from the caller.
sortBytakes a list:['region.name', '-name']or[{ column, order }], and a comma separated string means the same. A dotted entry sorts by a top-level belongs-to column, joined for the data query only. A collection column is a 400. bulkMode: 'perItem'keeps the 3.3 behaviour of one single-row call per item, in its own savepoint.- New exports:
parseCrudQuery, and the typesCrudFilter,FilterGroup,FilterOperators,FilterOperator,FilterScalar,ColumnFilter,SortInput,CursorPaginationOptions,CursorPage,CrudAllowlists,UpsertOptions,BulkMode,ParseCrudQueryOptionsandParsedCrudQuery. The Drizzle helpersbetween,notandnotInArrayare re-exported.
Changed
These change behaviour that existing code may rely on. Check each one before upgrading.
- Mass writes are set-based.
massUpdate,massSoftDelete,massRestoreandmassDeletecost oneSELECTthat checks every id plus oneUPDATEorDELETE ... WHERE id IN (...), andmassCreateone multi-rowINSERT, instead of one or two queries per id. TheBulkOperationExceptionbody is unchanged: when the statement fails, the batch is replayed item by item inside a savepoint that is rolled back, only to name the failing items. Hooks still run once per item, but theafter*hooks now run once the whole set is written instead of after each item. Duplicate ids are written once. PassbulkMode: 'perItem'for the old behaviour. - Create and update ignore the columns the package manages. Without
writableColumns, the soft delete column is dropped from a create or update body, and the primary key and thecreatedAtcolumn from an update body. An update whose only key was one of these is now a 400 ("there are no columns to update"). To write them on purpose, list them inwritableColumns. PaginationOptions.sortByisSortInput(string | Array<string | SortColumn>). Code that passes a string is unaffected; code that readssortByback as astringneeds a narrowing check.betweenis an operator now.{ col: { between: [a, b] } }used to be a 400 ("Unknown filter operator").buildOrderBytakes aSortInput, andbuildFilterConditionsandbuildCollectionFiltertake an optionaloptionsargument, for subclasses that call them.
Fixed
- Mass operations cost a fixed number of queries (BUG-16).
massUpdateover 10 ids was 20 queries; it is now 2. - The soft delete guide's trash and purge recipes work (BUG-17). They used raw Drizzle because
findAll({ deleted_at: { isNotNull: true } })always returned nothing; the guide now usesonlyDeletedandforceDelete.
[3.3.1] - 2026-11-02
Fixes from the November 2026 audit. Every fix below is proven by a spec that runs real SQL against
PGlite (test/pglite.integration.spec.ts) and failed before the change.
Fixed
- String filters on integer, uuid and enum columns no longer return a 500. Query strings send
every value as text, and with the default
caseSensitive: falsea filter such as{ author_id: '1' }becamelower(author_id), which Postgres rejects.lower()now only wraps text, varchar and char columns; every other column compares with=and Postgres casts the value. Relation and collection filters get the same fix. - Date strings work on date and timestamp columns.
{ publishedAt: { gt: '2024-01-01' } }used to crash inside the driver (value.toISOString is not a function). The string is now turned into aDate; a value that is not a date is a 400. - A soft-deleted belongs-to parent is no longer returned. The
LEFT JOINfor an eager load or a relation filter now carriesdeleted_at IS NULLin itsONclause, so the parent comes back asnulland{ author: { name: 'Bob' } }does not match a deleted author. findOnecan no longer hand back an arbitrary row.findOne({ email: undefined })used to runLIMIT 1with no condition and return the first row in the table. It is now a 400, as is a key that is not a column.nullnow meansIS NULLinstead of being skipped. An operator object works as it does infindAll.- A soft-delete or timestamp column the table does not have is caught at startup. With
camelCase keys (
deletedAt: timestamp('deleted_at')) the default config used to break every read with a SQL syntax error, andupdatedAtsilently never moved. The service now throws when it is built, naming the key to use:softDelete.column is "deleted_at", but the table has no column under that key. The column "deleted_at" is declared under the key "deletedAt"; set softDelete.column to "deletedAt". - One bad item in a bulk call no longer fails every item after it. Each item now runs in its own
savepoint, so
massCreate([ok, duplicate, ok, ok])reports the duplicate alone instead of two more25P02"current transaction is aborted" errors. The whole call still rolls back. The items still run one query (or two) at a time; set-based bulk writes are planned separately. - Bulk errors reach the HTTP response.
BulkOperationExceptionnow answers with{ statusCode, error, message, errors: [{ index | id, status, message }] }, one entry per failed item with the status that item alone would have produced. An error that is not an HTTP exception shows asstatus: 500with a generic message, so SQL never leaks. { isNull: false }meansIS NOT NULL. The value used to be ignored.isNullandisNotNullalso accept the strings"true"and"false"; anything else is a 400.- Filters the package does not understand are rejected instead of dropped. A new
eqoperator is supported, aDatevalue is an equality match instead of an empty operator object, and an unknown column, relation column or operator is a 400. Each of these used to return every row. - Bad input is a 400 on reads too. Postgres
22P02(wrong type, unknown enum label),22007and22008(bad dates) now map toValidationFailedExceptionon every path, includingfind,findAll,countandfullTextSearch.fullTextSearchchecks its column names (an unknown one used to be a SQL syntax error), andupdatewith nothing to set is a 400 instead of a raw "No values to set". fullTextSearchalways paginates. Without a pagination argument it returned every match while the envelope saidlimit: 20. The resolved page and limit now always apply, and the data and count queries run together.- A partial pagination override keeps the other half.
pagination: { defaultLimit: 5 }used to replace the whole object, leavingmaxLimitundefined and the query with no limit at all.softDelete,timestamps,paginationandsqlnow merge one level deep at every config layer:forRootdefaults,@CrudService,forFeatureand the service constructor. - Search and the
ilikeoperator emitLIKEon MySQL, which has noILIKE. MySQL's default collations already compare case-insensitively. - Pages are stable. The primary key is now always the last
ORDER BYcolumn, so rows that tie on the sort columns, or a list with no sort at all, can no longer repeat or skip between pages. - A row lock works with an eager belongs-to. Locks are now
FOR UPDATE OF <base table>(and the same forshareandno key update). Postgres used to refuse withFOR UPDATE cannot be applied to the nullable side of an outer join. - Nested collections key on their own table. A nested has-many or many-to-many used the root
service's
primaryKeyas its defaultparentKey, so a root keyed onuidloadedauthor.postsas[]. A nested level now defaults to its host table's own primary key column. - Types in public signatures are exported.
PaginationOptions,OperationOptions,SqlSearchOptions,SqlSearchModeandBulkOperationResultcome from the package root, along with the newCrudFeatureConfigandBulkOperationItemError. CrudFeature.configis typed asCrudFeatureConfiginstead ofRecord<string, any>, so a typo in a key no longer compiles.
Changed
These fixes change behaviour that existing code may rely on. Check each one before upgrading.
- An unknown filter key is a 400.
findAllandcountused to drop keys that were not columns, so passing a whole query DTO through worked even withpageorsortByin it. Strip non-filter fields first. The same goes for an unknown column inside a relation or collection filter, and for an unknown operator.nullandundefinedvalues are still skipped. findOnewith no usable condition, or an unknown key, is a 400. It used to return the first row in the table.findOne({ col: null })matchesIS NULL. It used to skip the key.- A configured soft-delete or timestamp key the table lacks stops the app at startup. This
includes the project defaults: with
defaults.timestampson (the default), every table needscreated_atandupdated_atkeys, or the entity must set its own keys or turn timestamps off withtimestamps: undefined. Before, a missing timestamp key was silently ignored. - Every
findAllandfullTextSearchends withORDER BY <primary key> ASC. A list with no sort configured used to come back in whatever order Postgres chose; it now comes back by primary key. update(id, {})is a 400, also when timestamps are on. It used to bumpupdated_atalone.{ isNull: false }returns the non-null rows instead of the null ones.BulkOperationExceptionhas a different response body.messageis unchanged;errorsis new. Theerrorsproperty on the exception still holds the original errors.- Read errors from bad input are 400s.
find('abc')on an integer key used to be a 500. - Row locks now carry
OF <table>. A subclass that relied on locking joined rows must take that lock itself.
Deprecated
sql.jsonSupport,sql.enableFullTextSearch,hooks.enableGlobalHooksandprimaryKeyType. Nothing reads them, so they have no effect. They are still accepted and will be removed in the next major version.primaryKeyTypeis now optional. The docs no longer claim thatjsonSupportenables JSON handling or thatenableFullTextSearchgatesfullTextSearch().DatabaseConnectionExceptionandTransactionException. Nothing in the package throws them.
[3.3.0] - 2026-08-10
Added
- Has-many, many-to-many and nested relations, all eager loaded without N+1. Declare
relations: { states: { table: states, type: 'hasMany', foreignKey: 'country_id' } }and passoptions.relations: ['states']tofind,findOneorfindAll. Each has-many relation costs exactly one extra query for the whole result set (WHERE country_id IN (...)), no matter how many parent rows come back, and the relations run concurrently. A page of 50 countries with their states is 3 queries: data, count, children. A parent with no children gets[], neverundefined. - Many-to-many through a join table. Declare
{ table: tags, type: 'manyToMany', through: countryTags, throughLocalKey: 'country_id', throughForeignKey: 'tag_id' }and the collection loads in one batched query per relation (SELECT ... FROM country_tags JOIN tags ... WHERE country_id IN (...)). The join-table key is used to group the rows and stripped before they are returned. - Nested relations, any depth, with a dotted path. Put a
relationsmap on a relation and address it withoptions.relations: ['states', 'states.cities']or['state.country']. Each nesting level costs one more batched query for the whole level, so a page of 50 countries with their states and every state's cities is 4 queries. Asking only forstate.countrypulls instateautomatically. orderByon a collection relation.{ type: 'hasMany', foreignKey: 'country_id', orderBy: [{ column: 'name', order: 'asc' }] }orders the children in SQL. An unknown column is warned about and skipped, as withdefaultSort.- Collections are never joined. Filtering by a child column
(
findAll({ states: { name: 'Kerala' } }),findAll({ tags: { name: 'himalayan' } })) compiles tocountries.id IN (SELECT ... WHERE ...), so parent rows are never duplicated andtotaland pagination stay correct. Belongs-to relations keep using aLEFT JOIN. options.selectnow narrows relation columns with a dotted path, at any depth.select: ['id', 'name', 'region.code', 'states.cities.name']projects only those columns, for the base table, a joined belongs-to relation and a batched collection alike. Listing only relation columns leaves the parent row complete. The parent key, the child foreign key and any key a nested level needs are added back automatically, because the grouping needs them.- An MCP server ships with the package.
npx nestjs-drizzle-crud-mcpserves the package docs (AGENT.md,README.md,CHANGELOG.md) to any MCP client through three tools:list_docs,get_docandsearch_docs. It speaks JSON-RPC over stdio, still has zero dependencies, and works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, Windsurf, Zed and Cline. AGENTS.template.mdfor every agent that is not Claude Code. It carries the same pointer toAGENT.mdand lists the filename each tool reads.CLAUDE.template.mdis unchanged.- Exported the
RelationType('belongsTo' | 'hasMany' | 'manyToMany'),RelationNodeandSelectTreetypes.
Changed
- A relation with a missing key column now throws at startup: belongs-to requires
localKey, has-many requiresforeignKey, many-to-many requiresthrough,throughLocalKeyandthroughForeignKey. Nested relations are validated too, and the message carries the full path (Relation "states.cities" is belongsTo and requires a localKey). It used to load nothing quietly, which read as bad data rather than bad config. RelationConfig.localKeyis optional, since has-many relations useforeignKeyinstead. Existing belongs-to configs are unaffected.
[3.2.2] - 2026-08-09
Fixed
- Restored the foreign-key mapping that 3.2.1 lost.
ForeignKeyViolationExceptionandEntityInUseExceptionare exported again, and a Postgres23503is translated by direction: 400 whencreate/updatereference a parent row that does not exist (the offending column is parsed out of the driverdetail), 409 when adeleteis blocked by rows that still reference this one. Non-FK errors on the delete path still bubble unchanged. Anyone who upgraded from 3.2.0 to 3.2.1 and started seeing 500s on bad references should move to this release. - Covered by six specs in
test/bug-fixes.spec.ts, including the wrappedDrizzleQueryErrorshape and the missing-detailfallback.
[3.2.1] - 2026-07-17
Changed
- Packaging and documentation only:
homepagenow points at crud.viliha.com, and the package and repository READMEs link the docs site, npm and GitHub. No runtime code changed.
Known issue
- The foreign-key mapping added in 3.2.0 is missing from this build. The move to the
Turborepo monorepo carried over a source tree from before 3.2.0, so
ForeignKeyViolationExceptionandEntityInUseExceptionare not exported and a23503bubbles as a 500 again. Fixed in 3.2.2, so upgrade rather than pinning here. The 3.1.1 and 3.2.0 entries below were lost in the same move and are restored here from the published tarballs.
[3.2.0] - 2026-07-09
Added
- Foreign-key violations (Postgres
23503) now map to a typed HTTP error instead of a raw 500, and the direction decides the status:create/updatereferencing a parent row that does not exist → 400ForeignKeyViolationException(a client-supplied reference that points at nothing is bad input). The offending column is parsed out of the driverdetail(e.g.language_id).deleteblocked because other rows still reference this one (ON DELETE RESTRICT/NO ACTION) → 409EntityInUseException.
- Both exceptions are exported from the package root.
Changed
deletenow wraps its statement execution so a23503on the delete side is translated (was previously left to bubble as a 500). Non-FK errors still bubble unchanged.- Reverses the prior deliberate choice to let FK violations bubble: a client-supplied FK is a recoverable bad value, not a programming error. NOT-NULL violations are still left to bubble.
[3.1.1] - 2026-07-03
Changed
- Package metadata only, no code changes: repository and issues URLs now point to myviliha/viliha-drizzle-crud, and the homepage points to the docs site at crud.viliha.com.
[3.1.0] - 2026-06-29
Added
findAll/countnow supportoptions.search. Callers can pass a search term and a list of table columns, e.g.{ search: { term: "na", columns: ["name", "code"] } }. The default mode is cross-columnILIKE '%term%';mode: "fullText"compiles a PostgreSQLto_tsvector(...) @@ plainto_tsquery(...)condition. The search predicate is applied to both the data query and the count query, so paginatedtotalstays correct.
[3.0.4] - 2026-06-21
Found while probing the package over real HTTP from the drizzle-pkg-demo consumer
(scripts/probe.sh). PostgreSQL-first. Verified by 56 jest specs + 56 HTTP e2e assertions.
Fixed
- Bad client input on
create/updatenow maps to 400, not a raw 500. A value that is too long for its column (Postgres22001), fails aCHECKconstraint (23514), or is numerically out of range (22003) previously surfaced as an unhandledDrizzleQueryError→ 500 Internal Server Error. These are now translated toValidationFailedException(400), mirroring the existing unique-violation → 409 mapping. NOT-NULL/FK violations are intentionally left to bubble (they usually indicate a programming/config error, not a recoverable bad value).
[3.0.3] - 2026-06-20
Correctness fix found while validating the package from a fresh NestJS consumer
(see drizzle-pkg-demo). PostgreSQL-first. Verified by 53 jest specs + 47 HTTP e2e assertions.
Fixed
- Case-insensitive string filters are now EXACT, not wildcard patterns. A plain string
value in a
findAll/countfilter (e.g.{ name: "foo" }) is documented as a case-insensitive exact match, but compiled toilike(column, value). So a value containing%,_or\was silently treated as aLIKEpattern and returned non-matching rows (e.g.{ title: "a_b" }matched"aXb";{ title: "a%" }matched everything). It now compiles tolower(column) = lower(value), so those characters are treated as literal data. The explicit{ like }/{ ilike }operators are unchanged for intentional pattern matching.
[3.0.2] - 2026-06-19
Residual-edge hardening found by an end-to-end HTTP probe of 3.0.1 (all LOW severity; no behavior change to the happy path). Verified by 35 HTTP assertions on Neon + 49 jest specs.
Changed
fullTextSearchnow returns the same envelope asfindAll,{ data, total, page, limit }instead of{ data, total }.page/limitare the resolved (clamped) values; the query is still only constrained when the caller passespagination. Callers paginating search results can now read back the page/limit they got.
Fixed
- Invalid
sortOrdernow fails fast (400).?sortOrder=<anything but asc/desc>previously fell through to ascending silently; it now throwsBadRequestException, mirroring the unknown-sortBycheck added in 3.0.1. - Non-finite numeric filter operands return 400, not 500. A
{ gt: NaN }/{ lte: Infinity }operand ongt/gte/lt/lte(e.g. from an unguardedNumber('abc')in a controller) reached SQL and surfaced as an opaqueDatabaseException(500). It is now rejected asBadRequestException. Non-number operands (dates, strings) are unaffected.
[3.0.1] - 2026-06-19
Correctness pass: typed exceptions now map to real HTTP status codes, plus several read-path fixes. (PostgreSQL-first.)
Fixed
- Exceptions extend
HttpExceptionso Nest maps them automatically:EntityNotFoundException→ 404,DuplicateEntityException→ 409,ValidationFailedException/BulkOperationException→ 400,Database*/TransactionException→ 500. Previously every error surfaced as a generic 500. - Duplicate-key translation. A Postgres unique violation (SQLSTATE
23505, on eithererr.codeor the Drizzle-wrappederr.cause.code) is converted toDuplicateEntityException(409), parsing the offending field/value from the driverdetail. fullTextSearchexcludes soft-deleted rows (added theIS NULLguard on the soft-delete column to both the data and count queries, matchingfindAll/count).- Pagination clamping.
page < 1,limit <= 0, andlimit > maxLimitare clamped via a sharedresolvePaginationhelper. No more negativeOFFSETorLIMIT 0. - Unknown sort column fails fast. A caller-supplied
sortBynot on the table throwsBadRequestException; an unknown column in a configureddefaultSortis warned and skipped. restore()returns the restored row on the PostgresRETURNINGpath (no longer re-find()s, which would have excluded the just-restored row via the soft-delete filter).
Added
- Row-level lock options on Postgres reads (
find/findOne/findAll):lock: 'update' | 'share'andforNoKeyUpdateapply.for(...). No-op on MySQL.
[3.0.0] - 2026-06-19
- First release under the
nestjs-drizzle-crudname with the 3.x API surface (DrizzleCrudModule.forRoot/forRootAsync/forFeature,SqlBaseCrudService).
Earlier (≤ 2.2.0)
Published as @quybquang/nestjs-drizzle-crud. Notable: 2.2.0 added a configurable module-level
default sort; 2.1.2 documented the timestamps feature. See git history for details.
Documentation changes
The release notes above cover the package. This list covers the docs pages themselves: every recent commit that changed one, newest first, read from git when the site was built.
Common questions
Semantic Versioning. A patch release fixes behaviour, a minor release adds features, and removing or renaming anything exported from the package root needs a major release.
In the next major version. Deprecated settings such as primaryKeyType, sql.jsonSupport and sql.enableFullTextSearch still compile in 3.x but have no effect.
The 3.x line. Versions before 3.0 do not, according to the security policy in the repository.
It is a copy of CHANGELOG.md in the package, which is the single record of release history. The npm tarball ships the same file.
Next steps
Error handling in NestJS with Drizzle
The HTTP status of every exception the package throws.
nestjs-drizzle-crud facts for AI agents
The condensed fact sheet for code generation.
Getting help
Ask a question, report a bug or a security issue.
nestjs-drizzle-crud facts for AI agents
A condensed fact sheet of nestjs-drizzle-crud for AI coding agents, with setup, generics, return shapes, filters, relations, errors and anti-patterns.
Getting help with nestjs-drizzle-crud
Get help with nestjs-drizzle-crud. Ask in GitHub Discussions, report bugs as issues, report security issues privately, and include what to send.