Skip to content

v0.1.1

@classytic-bot classytic-bot tagged this 21 Apr 18:06
Add allowDataInjection option (default true) so writes whose data /
dataArray already carry the tenant column no longer trip the
requireOnWrite:true throw. The plugin skips both the throw and its own
stamping, so a host-supplied tenant value is preserved verbatim and not
overwritten.

Also add skipWhen(context, operation) for parity with mongokit — closes
the gap where sqlitekit had no escape hatch for super-admin-style
bypasses. Runs before resolveTenantId and before the data-injection
check, so skipWhen:true short-circuits the plugin entirely.

createMany requires every row to be stamped; partial stamping falls
through to the throw. Set allowDataInjection:false to restore strict
pre-0.1.1 behavior. Read-side scoping is unchanged.

Tests added in tests/integration/plugins.test.ts: single-row data
injection, resolver-wins-over-data, createMany all-or-nothing, strict
mode, skipWhen + ordering.
Assets 2
Loading