viborm 1.9.0 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bun-sql.mjs +1 -1
- package/dist/bun-sqlite.mjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/client-BojZRIyT.mjs +2 -0
- package/dist/client-BojZRIyT.mjs.map +1 -0
- package/dist/d1.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/instrumentation.mjs +1 -1
- package/dist/libsql.mjs +1 -1
- package/dist/mysql2.mjs +1 -1
- package/dist/neon-http.mjs +1 -1
- package/dist/ordering.d.mts +18 -7
- package/dist/ordering.mjs +10 -10
- package/dist/ordering.mjs.map +1 -1
- package/dist/pg.mjs +1 -1
- package/dist/pglite.mjs +1 -1
- package/dist/planetscale.mjs +1 -1
- package/dist/postgres.mjs +1 -1
- package/dist/rows-of-qH0_KyL6.mjs +2 -0
- package/dist/rows-of-qH0_KyL6.mjs.map +1 -0
- package/dist/soft-delete.d.mts +3 -0
- package/dist/soft-delete.mjs +1 -1
- package/dist/soft-delete.mjs.map +1 -1
- package/dist/sqlite3.mjs +1 -1
- package/dist/version-Cam5kto_.mjs +2 -0
- package/dist/{version-B7NRPl4T.mjs.map → version-Cam5kto_.mjs.map} +1 -1
- package/package.json +7 -7
- package/dist/client-BpQs13Fn.mjs +0 -2
- package/dist/client-BpQs13Fn.mjs.map +0 -1
- package/dist/rows-of-Djavcb19.mjs +0 -2
- package/dist/rows-of-Djavcb19.mjs.map +0 -1
- package/dist/version-B7NRPl4T.mjs +0 -2
package/dist/postgres.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-BuuaeEvq.mjs";import{l as t}from"./execution-context-_oajgBi4.mjs";import{n}from"./base-wlv81COV.mjs";import{f as r,r as i,u as a}from"./error-mapping-D--MVRCY.mjs";import{t as o}from"./query-CTna5P9o.mjs";import{n as s}from"./suppressed-failure-DO0ej03b.mjs";import{n as c}from"./client-
|
|
1
|
+
import{n as e}from"./chunk-BuuaeEvq.mjs";import{l as t}from"./execution-context-_oajgBi4.mjs";import{n}from"./base-wlv81COV.mjs";import{f as r,r as i,u as a}from"./error-mapping-D--MVRCY.mjs";import{t as o}from"./query-CTna5P9o.mjs";import{n as s}from"./suppressed-failure-DO0ej03b.mjs";import{n as c}from"./client-BojZRIyT.mjs";import{i as l,t as u}from"./pinned-session-De2rDjdO.mjs";import{c as d,d as f,f as p,i as m,o as h,s as g,t as _,u as v}from"./driver-XlmOJFRH.mjs";import{t as y}from"./postgres-result-ehQiy2H-.mjs";import{t as b}from"./postgres-adapter-CdUHI_lw.mjs";import{n as x,t as S}from"./relation-bound-5hindjxU.mjs";import C from"postgres";const w={timestamp:{to:1114,from:[1082,1114,1184],serialize:e=>e instanceof Date?e.toISOString():String(e),parse:e=>e},json:{to:114,from:[114,3802],serialize:e=>typeof e==`string`?e:JSON.stringify(e),parse:e=>JSON.parse(e)}};function encodeListParameters(e){return e.map(e=>Array.isArray(e)?`{${e.map(e=>e===null?`NULL`:`"${String(e).replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`).join(`,`)}}`:e)}const withVibormTypes=(e={})=>({...e,types:{...w,...e.types}}),T={client:!0,options:!0,pgvector:!0,postgis:!0,sharedRelationBodies:!0,relationsPerStatement:!0,databaseUrl:!0,namespace:!0,migrationSessionAttestation:!0},isTransaction=e=>`savepoint`in e;var PostgresDriver=class extends _{maxBindParametersPerStatement=65533;driverOptions;suppliedClient;constructor(e={}){super(`postgresql`,`postgres`);let t=f(e);this.driverOptions={databaseUrl:e.databaseUrl,options:{...e.options}},this.suppliedClient=e.client;let{host:n,hostname:r}=this.driverOptions.options??{};if(g(`postgres`,e,!!(this.suppliedClient||n||r)),this.suppliedClient){for(let e of[1082,1114,1184])if(this.suppliedClient.options?.parsers[e]!==w.timestamp?.parse)throw new o(`A supplied postgres.js client must use VibORM temporal parsers; construct postgres(url, { types: vibormTypes }).`,{meta:{driver:`postgres`,operation:`configuration`}});this.client=this.suppliedClient}b(this,t,e),S(this.adapter,()=>{let e=this.client;return e&&!isTransaction(e)?e.parameters.server_version:void 0}),h(this,`migrationSessionAttestation`,v(e))}migrationSessionEndpoints(){let{databaseUrl:e,options:t}=this.driverOptions;return[e,t?.host,t?.hostname,...this.suppliedClient?.options.host??[]]}async initClient(){if(this.suppliedClient!==void 0)return this.suppliedClient;let{databaseUrl:e,options:t}=this.driverOptions;return e?C(p(e),withVibormTypes(t)):C(withVibormTypes(t))}async closeClient(e){e!==this.suppliedClient&&await e.end()}async execute(e,t,n,r){return this.executeQuery(e,t,encodeListParameters(n),r,`execute`)}async executeRaw(e,t,n,r){return this.executeQuery(e,t,n,r,`executeRaw`)}async executeQuery(e,t,n,r,i){let a=r?.operation??i,o=await e.unsafe(t,n,{prepare:this.driverOptions.options?.prepare===!0}).catch(e=>{throw x(this.adapter,e),e});return{rows:o,rowCount:y(o.count,o.command,o,{provider:`postgres`,operation:a})}}transactionOptionSupport(){return{isolationLevel:`post-begin`,timeout:!0,maxWait:`unsupported`,maxWaitReason:`postgres.js acquires the connection inside client.begin(), which VibORM cannot observe or bound — the wait would be unbounded no matter what maxWait said`}}async transaction(e,n,i,o){if(isTransaction(e))throw a(this.driverName);return r({run:async t=>{let n=!1;try{return await e.begin(e=>(n=!0,t(e)))}catch(t){throw!n&&this.isConnectionFailure(t)&&await this.recoverFailedBegin(e,t,o?.maxWaitMs??5e3),t}},callback:n,phases:t(i),close:async()=>void 0})}isConnectionFailure(e){let t=i(e,{driverName:this.driverName,dialect:this.dialect});return t.code===n.CONNECTION_FAILED||t.code===n.CONNECTION_TIMEOUT}async recoverFailedBegin(e,t,n){let r=Date.now()+n;for(let n=0;n<2;n++){let n=r-Date.now();if(n<=0)break;try{(await m(()=>e.reserve(),e=>e.release(),n,{driverName:this.driverName,form:`callback`})).release();return}catch(e){if(s(t,e),!this.isConnectionFailure(e))break}}}async pinnedSession(){let e=await this.getClient({operation:`pinnedSession`});if(isTransaction(e))throw a(this.driverName);let t=await e.reserve();return{session:t,release:(n,r)=>l({driverName:this.driverName,discard:n,lost:r,reset:()=>t.unsafe(`SELECT pg_advisory_unlock_all()`),release:()=>t.release(),closeOwnedTransport:e===this.suppliedClient?void 0:async()=>{this.client=null,this.initPromise=null,await e.end({timeout:u/1e3})}})}}};function createClient(e){d(e,`postgres`,T);let{client:t,options:n={},pgvector:r,postgis:i,databaseUrl:a}=e,o=f(e),s=v(e);return c(e,new PostgresDriver({client:t,options:n,...Object.hasOwn(e,`databaseUrl`)?{databaseUrl:a}:{},pgvector:r,postgis:i,sharedRelationBodies:e.sharedRelationBodies,relationsPerStatement:e.relationsPerStatement,namespace:o,migrationSessionAttestation:s}))}export{PostgresDriver,createClient,w as vibormTypes};
|
|
2
2
|
//# sourceMappingURL=postgres.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./chunk-BuuaeEvq.mjs";import{t}from"./sql-BsBoKwaf.mjs";var InsertValue=class{},Stored=class extends InsertValue{compute(){throw Error(`Stored is no value: the update leaves its field out`)}},JoinedValue=class extends InsertValue{};const n=new WeakMap;var r=class RowsOf extends t{model;alias;judgement;where;constructor(e,t,n,r){super([`(viborm: rows of a model rendered outside a query)`],[]),this.model=e,this.alias=t,this.judgement=n,this.where=r}settle(e){RowsOf.fill(this,e)}};export{n as a,Stored as i,InsertValue as n,JoinedValue as r,r as t};
|
|
2
|
+
//# sourceMappingURL=rows-of-qH0_KyL6.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rows-of-qH0_KyL6.mjs","names":[],"sources":["../src/query-engine/raptor3/shared/insert-value.ts","../src/query-engine/raptor3/shared/rows-of.ts"],"sourcesContent":["import type { AnyModel } from \"@schema/model\";\nimport type { Sql } from \"@sql\";\nimport type { Queries } from \"./query\";\nimport type { Input } from \"./schema\";\n\n/** What an {@link InsertValue} is given to compute its values with. */\nexport interface InsertValueContext {\n readonly model: AnyModel;\n /** The INSERT's rows, every value final but the computed ones. */\n readonly rows: readonly Input[];\n /** The field the value is written to. */\n readonly field: string;\n readonly queries: Queries;\n readonly dialect: \"postgresql\" | \"mysql\" | \"sqlite\";\n /**\n * Run one read in the operation (its transaction, if any) and return its\n * raw rows; absent where the operation cannot read before writing (an\n * array transaction's batch), so the value must be an SQL expression.\n */\n readonly read?: (statement: Sql) => Promise<readonly Input[]>;\n}\n\n/**\n * A create value its extension computes once the rows of one INSERT are\n * final, after every incoming foreign key is assigned: a stamp of the `data`\n * capability that is an instance of this class is written where the caller\n * left the field out, not admitted as data. `compute` answers one value per\n * row it is asked about (the indexes of `rows` whose field holds this\n * instance), each a plain value or an SQL expression the INSERT evaluates.\n * An `update`'s data may hold one too (an official extension's call, never a\n * caller's payload): set aside from admission, its expression is the SET's.\n * The official ordering extension's appended and moved keys are the ones.\n */\nexport abstract class InsertValue {\n abstract compute(\n context: InsertValueContext,\n indexes: readonly number[]\n ): readonly unknown[] | Promise<readonly unknown[]>;\n}\n\n/**\n * An update value keeping the field as stored (an official extension's\n * call, never a caller's payload): set aside at admission as any\n * `InsertValue`, so no generated update value (`updatedAt()`) fills it,\n * then dropped from the data (an update left with nothing to write is one\n * that writes nothing), and not judged as a field the write writes.\n * Ordering's own writes place a row; they do not change it.\n */\nexport class Stored extends InsertValue {\n compute(): never {\n throw new Error(\"Stored is no value: the update leaves its field out\");\n }\n}\n\n/**\n * An `updateMany` value read from a derived table the UPDATE joins (an\n * official extension's call, never a caller's payload): `join` answers that\n * table, aliased, and the condition matching it to the row written, over the\n * target's columns qualified by `target`; `compute` answers the SET\n * expression over the table's columns. The engine joins it (`UPDATE … FROM`,\n * MySQL's `UPDATE … JOIN`), so one statement writes each row its own value\n * and the source is read once, before any row changes. Respacing's keys.\n */\nexport abstract class JoinedValue extends InsertValue {\n abstract join(\n queries: Queries,\n target: string\n ): { readonly source: Sql; readonly on: Sql };\n}\n\n/**\n * Each engine's renderer, by its schema then its driver's adapter: an\n * official extension that writes a statement of its own (ordering's\n * respacing) names tables and columns and binds values as the engine's\n * queries do, without importing the engine into its entry.\n */\nexport const renderers = new WeakMap<object, WeakMap<object, Queries>>();\n","import type { AnyModel } from \"@schema/model\";\nimport { Sql } from \"../../../sql/sql\";\nimport type { RowJudgement } from \"./row-scope\";\n\n/**\n * The rows of `model` the operation rendering it may see, under `alias`: a\n * condition an extension that writes its own SQL (ordering's subqueries)\n * puts beside a read of `model AS alias`, so that read takes the call's row\n * domain as every read of the engine does. The operation's `Queries`\n * settles it when it lowers the caller's fragment holding it (the call's\n * root domain at that alias, or `1 = 1`); rendered anywhere else, its text\n * is not SQL, so it cannot read past the domain unnoticed. With `judgement`,\n * the rows the call may write so (an update of those fields); with `where`,\n * of those the ones it matches, admitted as a `findMany`'s.\n */\nexport class RowsOf extends Sql {\n readonly model: AnyModel;\n readonly alias: string;\n readonly judgement: RowJudgement | undefined;\n readonly where: unknown;\n constructor(\n model: AnyModel,\n alias: string,\n judgement?: RowJudgement,\n where?: unknown\n ) {\n super([\"(viborm: rows of a model rendered outside a query)\"], []);\n this.model = model;\n this.alias = alias;\n this.judgement = judgement;\n this.where = where;\n }\n settle(condition: Sql): void {\n RowsOf.fill(this, condition);\n }\n}\n"],"mappings":"2EAiCA,IAAsB,YAAtB,KAAkC,GAerB,OAAb,cAA4B,WAAY,CACtC,SAAiB,CACf,MAAU,MAAM,sDAAsD,GAapD,YAAtB,cAA0C,WAAY,GAatD,MAAa,EAAY,IAAI,QC7D7B,IAAa,EAAb,MAAa,eAAe,CAAI,CAC9B,MACA,MACA,UACA,MACA,YACE,EACA,EACA,EACA,EACA,CACA,MAAM,CAAC,qDAAqD,CAAE,EAAE,CAAC,CACjE,KAAK,MAAQ,EACb,KAAK,MAAQ,EACb,KAAK,UAAY,EACjB,KAAK,MAAQ,EAEf,OAAO,EAAsB,CAC3B,OAAO,KAAK,KAAM,EAAU"}
|
package/dist/soft-delete.d.mts
CHANGED
|
@@ -8,6 +8,9 @@ interface SoftDeleteModel {
|
|
|
8
8
|
}
|
|
9
9
|
interface SoftDeleteConfig {
|
|
10
10
|
readonly models: Readonly<Record<string, SoftDeleteModel>>;
|
|
11
|
+
/** What a delete writes into `deletedBy`, fixed per derived client. */
|
|
12
|
+
readonly actorId?: string | number | bigint;
|
|
13
|
+
/** `actorId`'s name before 1.9.1, still accepted (`actor` names the request's actor in `permissions`). */
|
|
11
14
|
readonly actor?: string | number | bigint;
|
|
12
15
|
}
|
|
13
16
|
type Schema = VibORMConfig["schema"];
|
package/dist/soft-delete.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-BuuaeEvq.mjs";import{t}from"./query-CTna5P9o.mjs";const n=`viborm.softDelete`;function perModel(e,t,n){return Object.fromEntries(Object.entries(e.models).map(([e,n])=>[e,t(n)]))}function admitMarkers(e,r){for(let[i,{deletedAt:a}]of Object.entries(r.models)){let r=Object.hasOwn(e,i)?e[i][`~`].state.scalars:void 0;if(!(r&&Object.hasOwn(r,a)))continue;let o=r[a][`~`].state;if(o.type!==`datetime`||o.array||!o.nullable)throw new t(`softDelete: ${i}.${a} must be a nullable DateTime field (s.dateTime().nullable()): a live row holds null there.`,{meta:{extension:n}})}}function definitionOf(e,t){return{name:n,controls:{mode:{oneOf:[`soft`,`hard`]}},rows:{control:`deleted`,default:`without`,models:perModel(e,({deletedAt:e})=>({without:{root:{[e]:null},related:{[e]:null}},with:{},only:{root:{[e]:{not:null}},related:{[e]:null}}}),t)},deletion:{removeWhen:{mode:`hard`},models:perModel(e,({deletedAt:t,deletedBy:n})=>({at:t,assign:n?{[n]:e.actor??null}:{}}),t)},model:perModel(e,({deletedAt:e,deletedBy:t})=>n=>{let r={[e]:null,...t?{[t]:null}:{}},{update:i,updateMany:a,delete:o,deleteMany:s}=n,c={deleted:`only`,mode:`hard`};return{restore:e=>i({...e,data:r,deleted:`only`}),restoreMany:e=>a({...e,data:r,deleted:`only`}),purge:e=>o({...e,...c}),purgeMany:(e={})=>s({...e,...c})}},t)}}function apply(e,t){return admitMarkers(t.$schema,e),t.$extends(definitionOf(e,t.$schema))}function rowsStep(e,t){let{model:n,...r}=definitionOf(e,t.$schema);return admitMarkers(t.$schema,e),t.$extends(r)}function methodsStep(e,t){let{model:r}=definitionOf(e,t.$schema);return t.$extends({name:`${n}.restore`,model:r})}function softDelete(e){function extend(t){return apply(e,t)}function rows(t){return rowsStep(e,t)}function methods(t){return methodsStep(e,t)}return Object.assign(extend,{rows,methods})}export{softDelete};
|
|
1
|
+
import{n as e}from"./chunk-BuuaeEvq.mjs";import{t}from"./query-CTna5P9o.mjs";const n=`viborm.softDelete`;function perModel(e,t,n){return Object.fromEntries(Object.entries(e.models).map(([e,n])=>[e,t(n)]))}function admitMarkers(e,r){if(r.actorId!==void 0&&r.actor!==void 0)throw new t(`softDelete: give actorId, not both actorId and actor (its former name).`,{meta:{extension:n}});for(let[i,{deletedAt:a}]of Object.entries(r.models)){let r=Object.hasOwn(e,i)?e[i][`~`].state.scalars:void 0;if(!(r&&Object.hasOwn(r,a)))continue;let o=r[a][`~`].state;if(o.type!==`datetime`||o.array||!o.nullable)throw new t(`softDelete: ${i}.${a} must be a nullable DateTime field (s.dateTime().nullable()): a live row holds null there.`,{meta:{extension:n}})}}function definitionOf(e,t){return{name:n,controls:{mode:{oneOf:[`soft`,`hard`]}},rows:{control:`deleted`,default:`without`,models:perModel(e,({deletedAt:e})=>({without:{root:{[e]:null},related:{[e]:null}},with:{},only:{root:{[e]:{not:null}},related:{[e]:null}}}),t)},deletion:{removeWhen:{mode:`hard`},models:perModel(e,({deletedAt:t,deletedBy:n})=>({at:t,assign:n?{[n]:e.actorId??e.actor??null}:{}}),t)},model:perModel(e,({deletedAt:e,deletedBy:t})=>n=>{let r={[e]:null,...t?{[t]:null}:{}},{update:i,updateMany:a,delete:o,deleteMany:s}=n,c={deleted:`only`,mode:`hard`};return{restore:e=>i({...e,data:r,deleted:`only`}),restoreMany:e=>a({...e,data:r,deleted:`only`}),purge:e=>o({...e,...c}),purgeMany:(e={})=>s({...e,...c})}},t)}}function apply(e,t){return admitMarkers(t.$schema,e),t.$extends(definitionOf(e,t.$schema))}function rowsStep(e,t){let{model:n,...r}=definitionOf(e,t.$schema);return admitMarkers(t.$schema,e),t.$extends(r)}function methodsStep(e,t){let{model:r}=definitionOf(e,t.$schema);return t.$extends({name:`${n}.restore`,model:r})}function softDelete(e){function extend(t){return apply(e,t)}function rows(t){return rowsStep(e,t)}function methods(t){return methodsStep(e,t)}return Object.assign(extend,{rows,methods})}export{softDelete};
|
|
2
2
|
//# sourceMappingURL=soft-delete.mjs.map
|
package/dist/soft-delete.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"soft-delete.mjs","names":[],"sources":["../src/soft-delete/index.ts"],"sourcesContent":["// viborm/soft-delete: the entire extension.\n\nimport type { OperationPayload } from \"../client/exports\"; // public today\nimport { ClientInitializationError } from \"../errors\"; // viborm's own class\nimport type {\n ClientSchema,\n ClientTypeState,\n DelegateOperationResult,\n ExtensionState,\n PendingOperation,\n VibORMClient,\n VibORMConfig,\n} from \"../index\";\n\nexport interface SoftDeleteModel {\n readonly deletedAt: string; // a nullable DateTime field of this model\n readonly deletedBy?: string; // optional scalar field for the actor\n}\nexport interface SoftDeleteConfig {\n readonly models: Readonly<Record<string, SoftDeleteModel>>;\n readonly actor?: string | number | bigint; // bound per derived client\n}\ntype Schema = VibORMConfig[\"schema\"];\ntype AnyModel = Schema[string];\ntype Names<Config extends SoftDeleteConfig> = keyof Config[\"models\"] & string;\n\nconst NAME = \"viborm.softDelete\";\n\n// One value per configured model, keys kept: the methods are typed from\n// them. The cast is TypeScript's own limit: Object.fromEntries forgets keys.\nfunction perModel<\n Config extends SoftDeleteConfig,\n T,\n S extends Schema = Schema,\n>(config: Config, build: (m: SoftDeleteModel) => T, _schema?: S) {\n return Object.fromEntries(\n Object.entries(config.models).map(([k, m]) => [k, build(m)])\n ) as { readonly [K in Names<Config> & keyof S]: T };\n}\n\n// restore and purge take the model's own update and delete arguments\n// (restore minus `data`); other keys are flagged.\ntype ArgsOf<\n C extends VibORMConfig,\n K,\n O extends \"update\" | \"updateMany\" | \"delete\" | \"deleteMany\",\n> = OperationPayload<O, ClientSchema<C>[K & keyof ClientSchema<C>]>;\ntype RestoreArgs<\n C extends VibORMConfig,\n K,\n O extends \"update\" | \"updateMany\",\n> = Omit<ArgsOf<C, K, O>, \"data\">;\ntype PurgeManyArgs<C extends VibORMConfig, K> = NonNullable<\n ArgsOf<C, K, \"deleteMany\">\n>;\ntype NoExtra<A, R> = A & Record<Exclude<keyof A, keyof R>, never>; // flags data and typos\n\n// Each result is typed from the delegate the method is called on (`Self`),\n// so it follows every extension applied after this one: a later `rows`\n// step types a to-one relation `| null`, a later `defaultOmit` drops a\n// field. Called off its delegate (destructured), its result is `unknown`:\n// using it is a type error, not a silent `never`. A type alias, not an interface: a method record.\ntype Methods<C extends VibORMConfig, K> = {\n restore<Self, A extends RestoreArgs<C, K, \"update\">>(\n this: Self,\n args: NoExtra<A, RestoreArgs<C, K, \"update\">>\n ): PendingOperation<DelegateOperationResult<Self, \"update\", A>>;\n restoreMany<Self, A extends RestoreArgs<C, K, \"updateMany\">>(\n this: Self,\n args: NoExtra<A, RestoreArgs<C, K, \"updateMany\">>\n ): PendingOperation<DelegateOperationResult<Self, \"updateMany\", A>>;\n purge<Self, A extends ArgsOf<C, K, \"delete\">>(\n this: Self,\n args: NoExtra<A, ArgsOf<C, K, \"delete\">>\n ): PendingOperation<DelegateOperationResult<Self, \"delete\", A>>;\n purgeMany<Self, A extends PurgeManyArgs<C, K> = PurgeManyArgs<C, K>>(\n this: Self,\n args?: NoExtra<A, PurgeManyArgs<C, K>>\n ): PendingOperation<DelegateOperationResult<Self, \"deleteMany\", A>>;\n};\n\ntype Governed<Config extends SoftDeleteConfig> = VibORMConfig & {\n readonly schema: Record<Names<Config>, AnyModel>;\n};\n\n/**\n * Refuse a marker that is not a nullable, single DateTime field, before the\n * definition is applied (its rows predicates would refuse a required field\n * less clearly; a string field would fail at the first delete). A model or\n * field the schema lacks is left to core, which names it.\n */\nfunction admitMarkers(schema: Schema, config: SoftDeleteConfig): void {\n for (const [name, { deletedAt }] of Object.entries(config.models)) {\n const scalars = Object.hasOwn(schema, name)\n ? schema[name]![\"~\"].state.scalars\n : undefined;\n if (!(scalars && Object.hasOwn(scalars, deletedAt))) continue;\n const state = scalars[deletedAt]![\"~\"].state;\n if (state.type !== \"datetime\" || state.array || !state.nullable)\n throw new ClientInitializationError(\n `softDelete: ${name}.${deletedAt} must be a nullable DateTime field (s.dateTime().nullable()): a live row holds null there.`,\n { meta: { extension: NAME } }\n );\n }\n}\n\n// One definition: the `mode` control, the rows each `deleted` value\n// selects, what a delete writes, and the methods, checked against base's\n// schema. A factory takes its delegate as `never` (it reads nothing typed at\n// this step), so later steps may add `rows` or `defaultOmit` freely.\nfunction definitionOf<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n>(config: Config, schema: ClientSchema<C>) {\n return {\n name: NAME,\n controls: { mode: { oneOf: [\"soft\", \"hard\"] } }, // deletion places it on managed deletes\n rows: {\n control: \"deleted\", // the call argument that picks a mode\n default: \"without\",\n models: perModel(\n config,\n ({ deletedAt }) => ({\n without: {\n root: { [deletedAt]: null },\n related: { [deletedAt]: null },\n },\n with: {},\n only: {\n root: { [deletedAt]: { not: null } },\n related: { [deletedAt]: null },\n },\n }),\n schema\n ),\n },\n deletion: {\n removeWhen: { mode: \"hard\" }, // this call deletes physically\n models: perModel(\n config,\n ({ deletedAt, deletedBy }) => ({\n at: deletedAt, // receives the call's one timestamp\n assign: deletedBy ? { [deletedBy]: config.actor ?? null } : {},\n }),\n schema\n ),\n },\n model: perModel(\n config,\n ({ deletedAt, deletedBy }) =>\n (delegate: never) => {\n const data = {\n [deletedAt]: null,\n ...(deletedBy ? { [deletedBy]: null } : {}),\n };\n const {\n update,\n updateMany,\n delete: remove,\n deleteMany,\n } = delegate as Record<string, (args: object) => never>; // one cast\n // Tombstones only: `deleted: \"only\"` overrides a caller's value.\n const tombstones = { deleted: \"only\", mode: \"hard\" };\n return {\n restore: (args: object) =>\n update!({ ...args, data, deleted: \"only\" }),\n restoreMany: (args: object) =>\n updateMany!({ ...args, data, deleted: \"only\" }),\n purge: (args: object) => remove!({ ...args, ...tombstones }),\n purgeMany: (args: object = {}) =>\n deleteMany!({ ...args, ...tombstones }),\n };\n },\n schema\n ) as unknown as {\n readonly [K in Names<Config> & keyof ClientSchema<C>]: (\n delegate: never\n ) => Methods<C, K>;\n },\n } as const; // the literals `$extends` reads: names, modes, values\n}\n\nfunction apply<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n X extends ExtensionState,\n>(config: Config, base: VibORMClient<C, X>) {\n admitMarkers(base.$schema, config);\n return base.$extends(definitionOf<Config, C>(config, base.$schema));\n}\n\n// The two steps a chain written before 1.8 applies around another entry's\n// (`rows` then `methods`): the definition without its methods, and the\n// methods alone, under the name they had.\nfunction rowsStep<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n X extends ExtensionState,\n>(config: Config, base: VibORMClient<C, X>) {\n const { model: _methods, ...rows } = definitionOf<Config, C>(\n config,\n base.$schema\n );\n admitMarkers(base.$schema, config);\n return base.$extends(rows);\n}\nfunction methodsStep<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n X extends ExtensionState,\n>(config: Config, client: VibORMClient<C, X>) {\n const { model } = definitionOf<Config, C>(config, client.$schema);\n return client.$extends({ name: `${NAME}.restore`, model });\n}\n\n// A step takes its receiver whole and reads its C and X once from\n// ClientTypeState, so `$extends(softDelete(config))` never infers them\n// against a generic client. The result names the step's own return type:\n// declarations reference one instantiation instead of inlining its\n// definition per use (each inline copy a distinct type, compared member by\n// member: TS2589 from 25 models).\ntype Receiver<Config extends SoftDeleteConfig> = ClientTypeState<\n VibORMConfig,\n ExtensionState\n> & {\n readonly $schema: Record<Names<Config>, AnyModel>;\n readonly $extends: (...args: never[]) => unknown;\n};\n// A step with `rows` follows no result consumer: no factory typed against\n// the client it extends (TypeScript's order rule; the official extensions'\n// factories read nothing typed, so they never are one).\ntype BeforeConsumers<X extends ExtensionState, Client> = [\n X[\"resultConsumer\"],\n] extends [undefined]\n ? Client\n : never;\ntype Applied<\n Config extends SoftDeleteConfig,\n Base,\n> = Base extends ClientTypeState<\n infer C extends Governed<Config>,\n infer X extends ExtensionState\n>\n ? Base extends VibORMClient<C, X>\n ? BeforeConsumers<X, ReturnType<typeof apply<Config, C, X>>>\n : never\n : never;\ntype Rowed<\n Config extends SoftDeleteConfig,\n Base,\n> = Base extends ClientTypeState<\n infer C extends Governed<Config>,\n infer X extends ExtensionState\n>\n ? Base extends VibORMClient<C, X>\n ? BeforeConsumers<X, ReturnType<typeof rowsStep<Config, C, X>>>\n : never\n : never;\ntype Restorable<\n Config extends SoftDeleteConfig,\n Base,\n> = Base extends ClientTypeState<\n infer C extends Governed<Config>,\n infer X extends ExtensionState\n>\n ? Base extends VibORMClient<C, X>\n ? ReturnType<typeof methodsStep<Config, C, X>>\n : never\n : never;\n// The whole factory's NoInfer keeps `$extends(softDelete(config))` from\n// inferring between two client types (which measures the client alias's\n// variance, ~650k instantiations once per program).\ntype SoftDeleteExtension<Config extends SoftDeleteConfig> = {\n <Base extends Receiver<Config>>(base: Base): NoInfer<Applied<Config, Base>>;\n /** The controls, rows and deletion alone (chains written before 1.8). */\n readonly rows: <Base extends Receiver<Config>>(\n base: Base\n ) => Rowed<Config, Base>;\n /** The methods alone (chains written before 1.8). */\n readonly methods: <Base extends Receiver<Config>>(\n client: Base\n ) => Restorable<Config, Base>;\n};\n\n/**\n * Keep deleted rows as tombstones: `client.$extends(softDelete({ models: {\n * post: { deletedAt: \"deletedAt\" } } }))`. One step, applied in any order\n * with the other extensions.\n */\nexport function softDelete<const Config extends SoftDeleteConfig>(\n config: Config\n): SoftDeleteExtension<Config> {\n function extend<Base extends Receiver<Config>>(\n base: Base\n ): NoInfer<Applied<Config, Base>>;\n function extend<C extends Governed<Config>, X extends ExtensionState>(\n base: VibORMClient<C, X>\n ) {\n return apply(config, base);\n }\n function rows<Base extends Receiver<Config>>(base: Base): Rowed<Config, Base>;\n function rows<C extends Governed<Config>, X extends ExtensionState>(\n base: VibORMClient<C, X>\n ) {\n return rowsStep(config, base);\n }\n function methods<Base extends Receiver<Config>>(\n client: Base\n ): Restorable<Config, Base>;\n function methods<C extends Governed<Config>, X extends ExtensionState>(\n client: VibORMClient<C, X>\n ) {\n return methodsStep(config, client);\n }\n return Object.assign(extend, { rows, methods });\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"soft-delete.mjs","names":[],"sources":["../src/soft-delete/index.ts"],"sourcesContent":["// viborm/soft-delete: the entire extension.\n\nimport type { OperationPayload } from \"../client/exports\"; // public today\nimport { ClientInitializationError } from \"../errors\"; // viborm's own class\nimport type {\n ClientSchema,\n ClientTypeState,\n DelegateOperationResult,\n ExtensionState,\n PendingOperation,\n VibORMClient,\n VibORMConfig,\n} from \"../index\";\n\nexport interface SoftDeleteModel {\n readonly deletedAt: string; // a nullable DateTime field of this model\n readonly deletedBy?: string; // optional scalar field for the actor\n}\nexport interface SoftDeleteConfig {\n readonly models: Readonly<Record<string, SoftDeleteModel>>;\n /** What a delete writes into `deletedBy`, fixed per derived client. */\n readonly actorId?: string | number | bigint;\n /** `actorId`'s name before 1.9.1, still accepted (`actor` names the request's actor in `permissions`). */\n readonly actor?: string | number | bigint;\n}\ntype Schema = VibORMConfig[\"schema\"];\ntype AnyModel = Schema[string];\ntype Names<Config extends SoftDeleteConfig> = keyof Config[\"models\"] & string;\n\nconst NAME = \"viborm.softDelete\";\n\n// One value per configured model, keys kept: the methods are typed from\n// them. The cast is TypeScript's own limit: Object.fromEntries forgets keys.\nfunction perModel<\n Config extends SoftDeleteConfig,\n T,\n S extends Schema = Schema,\n>(config: Config, build: (m: SoftDeleteModel) => T, _schema?: S) {\n return Object.fromEntries(\n Object.entries(config.models).map(([k, m]) => [k, build(m)])\n ) as { readonly [K in Names<Config> & keyof S]: T };\n}\n\n// restore and purge take the model's own update and delete arguments\n// (restore minus `data`); other keys are flagged.\ntype ArgsOf<\n C extends VibORMConfig,\n K,\n O extends \"update\" | \"updateMany\" | \"delete\" | \"deleteMany\",\n> = OperationPayload<O, ClientSchema<C>[K & keyof ClientSchema<C>]>;\ntype RestoreArgs<\n C extends VibORMConfig,\n K,\n O extends \"update\" | \"updateMany\",\n> = Omit<ArgsOf<C, K, O>, \"data\">;\ntype PurgeManyArgs<C extends VibORMConfig, K> = NonNullable<\n ArgsOf<C, K, \"deleteMany\">\n>;\ntype NoExtra<A, R> = A & Record<Exclude<keyof A, keyof R>, never>; // flags data and typos\n\n// Each result is typed from the delegate the method is called on (`Self`),\n// so it follows every extension applied after this one: a later `rows`\n// step types a to-one relation `| null`, a later `defaultOmit` drops a\n// field. Called off its delegate (destructured), its result is `unknown`:\n// using it is a type error, not a silent `never`. A type alias, not an interface: a method record.\ntype Methods<C extends VibORMConfig, K> = {\n restore<Self, A extends RestoreArgs<C, K, \"update\">>(\n this: Self,\n args: NoExtra<A, RestoreArgs<C, K, \"update\">>\n ): PendingOperation<DelegateOperationResult<Self, \"update\", A>>;\n restoreMany<Self, A extends RestoreArgs<C, K, \"updateMany\">>(\n this: Self,\n args: NoExtra<A, RestoreArgs<C, K, \"updateMany\">>\n ): PendingOperation<DelegateOperationResult<Self, \"updateMany\", A>>;\n purge<Self, A extends ArgsOf<C, K, \"delete\">>(\n this: Self,\n args: NoExtra<A, ArgsOf<C, K, \"delete\">>\n ): PendingOperation<DelegateOperationResult<Self, \"delete\", A>>;\n purgeMany<Self, A extends PurgeManyArgs<C, K> = PurgeManyArgs<C, K>>(\n this: Self,\n args?: NoExtra<A, PurgeManyArgs<C, K>>\n ): PendingOperation<DelegateOperationResult<Self, \"deleteMany\", A>>;\n};\n\ntype Governed<Config extends SoftDeleteConfig> = VibORMConfig & {\n readonly schema: Record<Names<Config>, AnyModel>;\n};\n\n/**\n * Refuse a marker that is not a nullable, single DateTime field, before the\n * definition is applied (its rows predicates would refuse a required field\n * less clearly; a string field would fail at the first delete). A model or\n * field the schema lacks is left to core, which names it.\n */\nfunction admitMarkers(schema: Schema, config: SoftDeleteConfig): void {\n if (config.actorId !== undefined && config.actor !== undefined)\n throw new ClientInitializationError(\n \"softDelete: give actorId, not both actorId and actor (its former name).\",\n { meta: { extension: NAME } }\n );\n for (const [name, { deletedAt }] of Object.entries(config.models)) {\n const scalars = Object.hasOwn(schema, name)\n ? schema[name]![\"~\"].state.scalars\n : undefined;\n if (!(scalars && Object.hasOwn(scalars, deletedAt))) continue;\n const state = scalars[deletedAt]![\"~\"].state;\n if (state.type !== \"datetime\" || state.array || !state.nullable)\n throw new ClientInitializationError(\n `softDelete: ${name}.${deletedAt} must be a nullable DateTime field (s.dateTime().nullable()): a live row holds null there.`,\n { meta: { extension: NAME } }\n );\n }\n}\n\n// One definition: the `mode` control, the rows each `deleted` value\n// selects, what a delete writes, and the methods, checked against base's\n// schema. A factory takes its delegate as `never` (it reads nothing typed at\n// this step), so later steps may add `rows` or `defaultOmit` freely.\nfunction definitionOf<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n>(config: Config, schema: ClientSchema<C>) {\n return {\n name: NAME,\n controls: { mode: { oneOf: [\"soft\", \"hard\"] } }, // deletion places it on managed deletes\n rows: {\n control: \"deleted\", // the call argument that picks a mode\n default: \"without\",\n models: perModel(\n config,\n ({ deletedAt }) => ({\n without: {\n root: { [deletedAt]: null },\n related: { [deletedAt]: null },\n },\n with: {},\n only: {\n root: { [deletedAt]: { not: null } },\n related: { [deletedAt]: null },\n },\n }),\n schema\n ),\n },\n deletion: {\n removeWhen: { mode: \"hard\" }, // this call deletes physically\n models: perModel(\n config,\n ({ deletedAt, deletedBy }) => ({\n at: deletedAt, // receives the call's one timestamp\n assign: deletedBy\n ? { [deletedBy]: config.actorId ?? config.actor ?? null }\n : {},\n }),\n schema\n ),\n },\n model: perModel(\n config,\n ({ deletedAt, deletedBy }) =>\n (delegate: never) => {\n const data = {\n [deletedAt]: null,\n ...(deletedBy ? { [deletedBy]: null } : {}),\n };\n const {\n update,\n updateMany,\n delete: remove,\n deleteMany,\n } = delegate as Record<string, (args: object) => never>; // one cast\n // Tombstones only: `deleted: \"only\"` overrides a caller's value.\n const tombstones = { deleted: \"only\", mode: \"hard\" };\n return {\n restore: (args: object) =>\n update!({ ...args, data, deleted: \"only\" }),\n restoreMany: (args: object) =>\n updateMany!({ ...args, data, deleted: \"only\" }),\n purge: (args: object) => remove!({ ...args, ...tombstones }),\n purgeMany: (args: object = {}) =>\n deleteMany!({ ...args, ...tombstones }),\n };\n },\n schema\n ) as unknown as {\n readonly [K in Names<Config> & keyof ClientSchema<C>]: (\n delegate: never\n ) => Methods<C, K>;\n },\n } as const; // the literals `$extends` reads: names, modes, values\n}\n\nfunction apply<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n X extends ExtensionState,\n>(config: Config, base: VibORMClient<C, X>) {\n admitMarkers(base.$schema, config);\n return base.$extends(definitionOf<Config, C>(config, base.$schema));\n}\n\n// The two steps a chain written before 1.8 applies around another entry's\n// (`rows` then `methods`): the definition without its methods, and the\n// methods alone, under the name they had.\nfunction rowsStep<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n X extends ExtensionState,\n>(config: Config, base: VibORMClient<C, X>) {\n const { model: _methods, ...rows } = definitionOf<Config, C>(\n config,\n base.$schema\n );\n admitMarkers(base.$schema, config);\n return base.$extends(rows);\n}\nfunction methodsStep<\n Config extends SoftDeleteConfig,\n C extends Governed<Config>,\n X extends ExtensionState,\n>(config: Config, client: VibORMClient<C, X>) {\n const { model } = definitionOf<Config, C>(config, client.$schema);\n return client.$extends({ name: `${NAME}.restore`, model });\n}\n\n// A step takes its receiver whole and reads its C and X once from\n// ClientTypeState, so `$extends(softDelete(config))` never infers them\n// against a generic client. The result names the step's own return type:\n// declarations reference one instantiation instead of inlining its\n// definition per use (each inline copy a distinct type, compared member by\n// member: TS2589 from 25 models).\ntype Receiver<Config extends SoftDeleteConfig> = ClientTypeState<\n VibORMConfig,\n ExtensionState\n> & {\n readonly $schema: Record<Names<Config>, AnyModel>;\n readonly $extends: (...args: never[]) => unknown;\n};\n// A step with `rows` follows no result consumer: no factory typed against\n// the client it extends (TypeScript's order rule; the official extensions'\n// factories read nothing typed, so they never are one).\ntype BeforeConsumers<X extends ExtensionState, Client> = [\n X[\"resultConsumer\"],\n] extends [undefined]\n ? Client\n : never;\ntype Applied<\n Config extends SoftDeleteConfig,\n Base,\n> = Base extends ClientTypeState<\n infer C extends Governed<Config>,\n infer X extends ExtensionState\n>\n ? Base extends VibORMClient<C, X>\n ? BeforeConsumers<X, ReturnType<typeof apply<Config, C, X>>>\n : never\n : never;\ntype Rowed<\n Config extends SoftDeleteConfig,\n Base,\n> = Base extends ClientTypeState<\n infer C extends Governed<Config>,\n infer X extends ExtensionState\n>\n ? Base extends VibORMClient<C, X>\n ? BeforeConsumers<X, ReturnType<typeof rowsStep<Config, C, X>>>\n : never\n : never;\ntype Restorable<\n Config extends SoftDeleteConfig,\n Base,\n> = Base extends ClientTypeState<\n infer C extends Governed<Config>,\n infer X extends ExtensionState\n>\n ? Base extends VibORMClient<C, X>\n ? ReturnType<typeof methodsStep<Config, C, X>>\n : never\n : never;\n// The whole factory's NoInfer keeps `$extends(softDelete(config))` from\n// inferring between two client types (which measures the client alias's\n// variance, ~650k instantiations once per program).\ntype SoftDeleteExtension<Config extends SoftDeleteConfig> = {\n <Base extends Receiver<Config>>(base: Base): NoInfer<Applied<Config, Base>>;\n /** The controls, rows and deletion alone (chains written before 1.8). */\n readonly rows: <Base extends Receiver<Config>>(\n base: Base\n ) => Rowed<Config, Base>;\n /** The methods alone (chains written before 1.8). */\n readonly methods: <Base extends Receiver<Config>>(\n client: Base\n ) => Restorable<Config, Base>;\n};\n\n/**\n * Keep deleted rows as tombstones: `client.$extends(softDelete({ models: {\n * post: { deletedAt: \"deletedAt\" } } }))`. One step, applied in any order\n * with the other extensions.\n */\nexport function softDelete<const Config extends SoftDeleteConfig>(\n config: Config\n): SoftDeleteExtension<Config> {\n function extend<Base extends Receiver<Config>>(\n base: Base\n ): NoInfer<Applied<Config, Base>>;\n function extend<C extends Governed<Config>, X extends ExtensionState>(\n base: VibORMClient<C, X>\n ) {\n return apply(config, base);\n }\n function rows<Base extends Receiver<Config>>(base: Base): Rowed<Config, Base>;\n function rows<C extends Governed<Config>, X extends ExtensionState>(\n base: VibORMClient<C, X>\n ) {\n return rowsStep(config, base);\n }\n function methods<Base extends Receiver<Config>>(\n client: Base\n ): Restorable<Config, Base>;\n function methods<C extends Governed<Config>, X extends ExtensionState>(\n client: VibORMClient<C, X>\n ) {\n return methodsStep(config, client);\n }\n return Object.assign(extend, { rows, methods });\n}\n"],"mappings":"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"}
|
package/dist/sqlite3.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-BuuaeEvq.mjs";import{n as t}from"./normalized-result-ByvlIQqa.mjs";import{t as n}from"./query-CTna5P9o.mjs";import{a as r,i,n as a,r as o}from"./client-
|
|
1
|
+
import{n as e}from"./chunk-BuuaeEvq.mjs";import{n as t}from"./normalized-result-ByvlIQqa.mjs";import{t as n}from"./query-CTna5P9o.mjs";import{a as r,i,n as a,r as o}from"./client-BojZRIyT.mjs";import{c as s,n as c,r as l,t as u}from"./driver-XlmOJFRH.mjs";import{a as d,c as f,i as p,l as m,n as h,o as g,s as _,t as v}from"./sqlite-utils-DztTzv08.mjs";import{t as y}from"./sqlite-adapter-BHx--tnz.mjs";import{Buffer as b}from"node:buffer";import x from"better-sqlite3";const S=new WeakMap,C=x.prototype.prepare;function cachedStatement(e,t,n){if(e.prepare!==C)return e.prepare(t);let r=S.get(e);r||(r=[new Map,new Map],S.set(e,r));let i=r[n?0:1],a=i.get(t);return a===void 0?(a=e.prepare(t),i.size===100&&i.delete(i.keys().next().value)):i.delete(t),i.set(t,a),a}function convertValuesForSQLite3(e){return e.map(e=>{let t=h(e);if(b.isBuffer(t)||!p(t))return t;let n=f(t);return b.from(n.buffer,n.byteOffset,n.byteLength)})}const w={client:!0,dataDir:!0,options:!0};var T=class SQLite3Driver extends u{static canonicalExecuteEntry=SQLite3Driver.prototype._execute;static canonicalExecute=SQLite3Driver.prototype.execute;static canonicalRunStatement=SQLite3Driver.prototype.runStatement;static canonicalTypedStatement=SQLite3Driver.prototype.executeTypedStatement;static canonicalPositionalExecute=SQLite3Driver.prototype.executePositional;static canonicalNativePrepare=x.prototype.prepare;adapter=new y;maxBindParametersPerStatement=32766;result=m;sqliteMigrationCapability=c;serializeTransactions=!0;get numbersPlaceholders(){return!1}driverOptions;suppliedClient;canonicalAdapterParseResult=this.adapter.result.parseResult;canonicalAdapter=this.adapter;canonicalAdapterResult=this.adapter.result;canonicalAdapterParseField=this.adapter.result.parseField;canonicalAdapterParseRelation=this.adapter.result.parseRelation;constructor(e={}){if(super(`sqlite`,`sqlite3`),this.driverOptions=e,this.suppliedClient=e.client,this.suppliedClient){if(this.suppliedClient.pragma(`foreign_keys`,{simple:!0})!==1)throw new n(`A supplied SQLite database must enable PRAGMA foreign_keys = ON before wrapping.`,{meta:{driver:`sqlite3`}});this.client=this.suppliedClient,Object.defineProperty(this,`connectionQueue`,{value:l(this.suppliedClient)})}SQLite3Driver.isPositionalCandidate(this)&&r(this,(e,t)=>this.executePositional(e,t),SQLite3Driver.isPositionalCandidate)}async initClient(){if(this.suppliedClient!==void 0)return this.suppliedClient;let e=this.driverOptions.dataDir??`:memory:`,t=this.driverOptions.options??{},n=new x(e,t);return n.pragma(`foreign_keys = ON`),t.timeout===void 0&&n.pragma(`busy_timeout = 5000`),n}async closeClient(e){e!==this.suppliedClient&&e.close()}async execute(e,t,n,r){let i=convertValuesForSQLite3(n);return this.runStatement(e,t,i,r?.model!==`$raw`)}async executeRaw(e,t,n){let r=n?convertValuesForSQLite3(n):void 0;return this.runStatement(e,t,r,!1)}async executePositional(e,n){let r,a=await this.executeTypedStatement(e,n,async(e,n,i,a)=>{let s={provider:this.driverName,operation:a.operation??`execute`};if(!SQLite3Driver.isPositionalProducer(this,e)){let r=await this.execute(e,n,i,a);return t(r,s),{kind:`borrowed`,result:r}}let c=convertValuesForSQLite3(i),l=cachedStatement(e,n,!0);if(!l.reader){let e={rows:[],rowCount:l.run(...c).changes};return t(e,s),{kind:`borrowed`,result:e}}r=e,l.safeIntegers(!0);let u=l.raw().all(...c),d=l.columns().map(e=>e.name);return o(u,d,s),{kind:`positional`,rows:u,columns:d}});return a.kind===`positional`&&!(r&&SQLite3Driver.isPositionalProducer(this,r))?{kind:`borrowed`,result:i(a)}:a}static isPositionalProducer(e,t){return SQLite3Driver.isPositionalCandidate(e)&&e.client===t}static isPositionalCandidate(e){return e instanceof SQLite3Driver?e.driverOptions.options?.nativeBinding===void 0&&SQLite3Driver.hasCanonicalProducerSurface(e)&&e.executeTypedStatement===SQLite3Driver.canonicalTypedStatement&&e.executePositional===SQLite3Driver.canonicalPositionalExecute&&e.result.parseField===g&&e.result.parseRelation===void 0&&e.result.parseResult===void 0&&e.adapter===e.canonicalAdapter&&e.adapter.result===e.canonicalAdapterResult&&e.adapter.result.parseField===e.canonicalAdapterParseField&&e.adapter.result.parseRelation===e.canonicalAdapterParseRelation&&(e.client===void 0||e.client===null||SQLite3Driver.isPositionalClient(e.client)):!1}static isPositionalClient(e){return Object.getPrototypeOf(e)===x.prototype&&!Object.hasOwn(e,`prepare`)&&Object.getOwnPropertyDescriptor(x.prototype,`prepare`)?.value===SQLite3Driver.canonicalNativePrepare}runStatement(e,t,n,r){let i=r?cachedStatement(e,t,!1):e.prepare(t);if(i.reader){i.safeIntegers(!0);let e=n?i.all(...n):i.all();return{rows:r?e:d(e),rowCount:e.length}}return{rows:[],rowCount:(n?i.run(...n):i.run()).changes}}static hasCanonicalProducerSurface(e){return Object.getPrototypeOf(e)===SQLite3Driver.prototype&&e._execute===SQLite3Driver.canonicalExecuteEntry&&e.execute===SQLite3Driver.canonicalExecute&&e.runStatement===SQLite3Driver.canonicalRunStatement&&e.result===m&&e.adapter.result.parseResult===e.canonicalAdapterParseResult}transactionOptionSupport(){return v}async transaction(e,t,n){return _(e,t,n)}};function createClient(e){s(e,`sqlite3`,w,{databaseUrl:`pass the database file as dataDir`});let{client:t,dataDir:n,options:r}=e;return a(e,new T({client:t,dataDir:n,options:r}))}export{T as SQLite3Driver,createClient};
|
|
2
2
|
//# sourceMappingURL=sqlite3.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-
|
|
1
|
+
{"version":3,"file":"version-Cam5kto_.mjs","names":["packageMetadata.version"],"sources":["../package.json","../src/version.ts"],"sourcesContent":["","import packageMetadata from \"../package.json\";\n\n/** Package version shared by runtime surfaces and bundled from package.json. */\nexport const VIBORM_VERSION = packageMetadata.version;\n"],"mappings":"ACGA,MAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "viborm",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"description": "Type-safe ORM for PostgreSQL, MySQL, and SQLite with a Prisma-inspired API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -423,8 +423,8 @@
|
|
|
423
423
|
"name": "pg application + soft delete",
|
|
424
424
|
"path": "node_modules/.cache/viborm-size/pg-soft-delete.mjs",
|
|
425
425
|
"gzip": true,
|
|
426
|
-
"limit": "201 kB",
|
|
427
|
-
"message": "Raised 173.5 → 178.6 kB by the measured +5,670 B (178.24 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 178.6 → 179.9 kB by the measured +1,270 B (179.51 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179.9 → 180.7 kB by the measured 180.39 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), createClient forwarding sharedRelationBodies (ENG-5), and soft delete's module-level steps (COST-1, COST-2) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 180,978 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 183,799 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 184,116 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 188,764 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 192,936 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 193,977 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 194,609 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 195,500 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 196.66 kB on CI's Node 22.12 build, so 195.8 kB → 197 kB under the same OD-17 rule. 1.5.1 (2026-10-26) measures 197,060 B: provider codes of any SQLSTATE-shaped class kept, a PostgreSQL connection lost under a statement mapped to a retryable ConnectionError, a migration failure keeping its cause's disclosure, and the client symbol migrations read diagnostics through; 197 kB → 197.4 kB under the same OD-17 rule. viborm/on (2026-10-29) measures 197,461 B (+258 B): the write-hooks seam core keeps for the official `on` extension (its identity in the chain, the client's write plan and its one outcome registration, the engine's upsert arm report) and the MySQL createMany skipDuplicates fix; 197.4 kB → 197.8 kB under the same OD-17 rule. The statements a write hook costs, lowered (2026-10-29): a PostgreSQL upsert keeps its one INSERT … ON CONFLICT and reads its arm from RETURNING (adapter.mutations.upserted, xmax = 0), and without RETURNING a createMany whose rows carry their keys is one INSERT plus one read and a delete with a scalar select locks and reads its rows in one SELECT … FOR UPDATE: measures 197.76 kB; 197.8 kB → 198.1 kB under the same OD-17 rule. viborm/on nested writes and onError (2026-10-29: nested rows captured by key in the operation's own unit, nested updateMany/deleteMany from their own RETURNING, a failing hook reported to onError instead of failing its committed write) measures 198.54 kB; 198.1 kB → 198.9 kB under the same OD-17 rule. viborm/ordering's core seam (2026-10-31) measures 199.26 kB; 198.9 kB → 199.6 kB under the same OD-17 rule. viborm/ordering's move in one UPDATE (2026-10-31: an update's data may hold an extension-computed value, set aside from admission and replaced by its expression before the SET) measures 199.62 kB; 199.6 kB → 200 kB under the same OD-17 rule. Extensions next, final (2026-11-01) measures 200,087 B: the core RowsOf seam (an extension's own SQL takes the call's row domain, about 0.1 kB in every app) beside soft delete's one-step definition, purge and marker check; 200 kB → 200.4 kB under OD-17. A policy's tenant (2026-11-02: the bound a layer's own related rows put on the sets its predicates compute over a whole table, read positively, and the polarity of what a rule reads, so a negative test is never bounded) measures 200.68 kB; 200.4 kB → 201 kB under the same OD-17 rule."
|
|
426
|
+
"limit": "201.4 kB",
|
|
427
|
+
"message": "Raised 173.5 → 178.6 kB by the measured +5,670 B (178.24 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 178.6 → 179.9 kB by the measured +1,270 B (179.51 kB) of RBAC M2 wave 5 (E5: shared relation bodies, D1 balanced conjunctions, the judged write's own sentinel, the allocation fixes; the uncacheable control, OD-10; OD-17, measured + 0.3 kB headroom). Raised 179.9 → 180.7 kB by the measured 180.39 kB of the RBAC second review's fixes (2026-10-17): per-dialect produced rows for a judged createMany (ENG-3, setOperations.typedRows), caller SQL kept out of shared-body keys (ENG-4, Sql.peekRuns), isolated nesting levels where deepExpressions is false (ENG-6, subqueries.isolated), createClient forwarding sharedRelationBodies (ENG-5), and soft delete's module-level steps (COST-1, COST-2) (OD-17, measured rounded up to 0.1 kB + 0.3 kB). Permissions application reuse (2026-10-18) measures 180,978 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 183,799 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 184,116 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 188,764 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 192,936 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 193,977 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 194,609 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 195,500 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 196.66 kB on CI's Node 22.12 build, so 195.8 kB → 197 kB under the same OD-17 rule. 1.5.1 (2026-10-26) measures 197,060 B: provider codes of any SQLSTATE-shaped class kept, a PostgreSQL connection lost under a statement mapped to a retryable ConnectionError, a migration failure keeping its cause's disclosure, and the client symbol migrations read diagnostics through; 197 kB → 197.4 kB under the same OD-17 rule. viborm/on (2026-10-29) measures 197,461 B (+258 B): the write-hooks seam core keeps for the official `on` extension (its identity in the chain, the client's write plan and its one outcome registration, the engine's upsert arm report) and the MySQL createMany skipDuplicates fix; 197.4 kB → 197.8 kB under the same OD-17 rule. The statements a write hook costs, lowered (2026-10-29): a PostgreSQL upsert keeps its one INSERT … ON CONFLICT and reads its arm from RETURNING (adapter.mutations.upserted, xmax = 0), and without RETURNING a createMany whose rows carry their keys is one INSERT plus one read and a delete with a scalar select locks and reads its rows in one SELECT … FOR UPDATE: measures 197.76 kB; 197.8 kB → 198.1 kB under the same OD-17 rule. viborm/on nested writes and onError (2026-10-29: nested rows captured by key in the operation's own unit, nested updateMany/deleteMany from their own RETURNING, a failing hook reported to onError instead of failing its committed write) measures 198.54 kB; 198.1 kB → 198.9 kB under the same OD-17 rule. viborm/ordering's core seam (2026-10-31) measures 199.26 kB; 198.9 kB → 199.6 kB under the same OD-17 rule. viborm/ordering's move in one UPDATE (2026-10-31: an update's data may hold an extension-computed value, set aside from admission and replaced by its expression before the SET) measures 199.62 kB; 199.6 kB → 200 kB under the same OD-17 rule. Extensions next, final (2026-11-01) measures 200,087 B: the core RowsOf seam (an extension's own SQL takes the call's row domain, about 0.1 kB in every app) beside soft delete's one-step definition, purge and marker check; 200 kB → 200.4 kB under OD-17. A policy's tenant (2026-11-02: the bound a layer's own related rows put on the sets its predicates compute over a whole table, read positively, and the polarity of what a rule reads, so a negative test is never bounded) measures 200.68 kB; 200.4 kB → 201 kB under the same OD-17 rule. 1.9.1 (2026-11-02: the upsert fold under other models' stamps, ordering's writes keeping updatedAt() and its anchors read by key, softDelete actorId) measures 201.05 kB on CI's Node 22.12 build; 201 kB → 201.4 kB under the same OD-17 rule."
|
|
428
428
|
},
|
|
429
429
|
{
|
|
430
430
|
"name": "soft-delete extension entry",
|
|
@@ -465,8 +465,8 @@
|
|
|
465
465
|
"name": "pg application + ordering",
|
|
466
466
|
"path": "node_modules/.cache/viborm-size/pg-ordering.mjs",
|
|
467
467
|
"gzip": true,
|
|
468
|
-
"limit": "208.
|
|
469
|
-
"message": "The pg application with viborm/ordering applied (one ordered model, a create and a move): its difference from the pg application row is what ordering a list costs, measured 203,010 B (+4,160 B) on 2026-10-31. Limit follows OD-17: measured rounded up to 0.1 kB plus 0.3 kB. The adversarial review's fixes (2026-10-31: respacing as one statement over whole lists, rows named by identity in move, stored keys published instead of their expressions, the filtered MAX for backfilled tables) measure 203.87 kB; 203.4 kB → 204.2 kB under the same OD-17 rule. The second review's fixes (2026-10-31) measure 204.22 kB; 204.2 kB → 204.6 kB under the same OD-17 rule. The move computed by its UPDATE (2026-10-31: the key expression between.ts builds, the one-statement path, the engine's computed update values) measures 206.17 kB; 204.6 kB → 206.5 kB under the same OD-17 rule. Extensions next (2026-11-01) measures 206,552 B (+95 B): ordering as one definition, the move's anchor read through the caller's view under rows, rekey invalidating the call's chain's cache, the scope's chain facts in core; 206.5 kB → 206.9 kB under the same OD-17 rule. Extensions next, final (2026-11-01) measures 207,840 B: move's subqueries through the call's row domain (RowsOf), and rekey as an updateMany through the client whose ranks keep the members the caller cannot see in place (one SQL map on PostgreSQL and SQLite, a read and a CASE on MySQL); 206.9 kB → 208.2 kB under the same OD-17 rule."
|
|
468
|
+
"limit": "208.9 kB",
|
|
469
|
+
"message": "The pg application with viborm/ordering applied (one ordered model, a create and a move): its difference from the pg application row is what ordering a list costs, measured 203,010 B (+4,160 B) on 2026-10-31. Limit follows OD-17: measured rounded up to 0.1 kB plus 0.3 kB. The adversarial review's fixes (2026-10-31: respacing as one statement over whole lists, rows named by identity in move, stored keys published instead of their expressions, the filtered MAX for backfilled tables) measure 203.87 kB; 203.4 kB → 204.2 kB under the same OD-17 rule. The second review's fixes (2026-10-31) measure 204.22 kB; 204.2 kB → 204.6 kB under the same OD-17 rule. The move computed by its UPDATE (2026-10-31: the key expression between.ts builds, the one-statement path, the engine's computed update values) measures 206.17 kB; 204.6 kB → 206.5 kB under the same OD-17 rule. Extensions next (2026-11-01) measures 206,552 B (+95 B): ordering as one definition, the move's anchor read through the caller's view under rows, rekey invalidating the call's chain's cache, the scope's chain facts in core; 206.5 kB → 206.9 kB under the same OD-17 rule. Extensions next, final (2026-11-01) measures 207,840 B: move's subqueries through the call's row domain (RowsOf), and rekey as an updateMany through the client whose ranks keep the members the caller cannot see in place (one SQL map on PostgreSQL and SQLite, a read and a CASE on MySQL); 206.9 kB → 208.2 kB under the same OD-17 rule. 1.9.1 (2026-11-02: the upsert fold under other models' stamps, ordering's writes keeping updatedAt() and its anchors read by key, softDelete actorId) measures 208.53 kB on CI's Node 22.12 build; 208.2 kB → 208.9 kB under the same OD-17 rule."
|
|
470
470
|
},
|
|
471
471
|
{
|
|
472
472
|
"name": "ordering extension entry",
|
|
@@ -491,8 +491,8 @@
|
|
|
491
491
|
"name": "every public entry",
|
|
492
492
|
"path": "node_modules/.cache/viborm-size/full.mjs",
|
|
493
493
|
"gzip": true,
|
|
494
|
-
"limit": "
|
|
495
|
-
"message": "Raised 394 → 398.1 kB by the measured +5,700 B (397.74 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 398.1 → 405.9 kB by the measured +7,818 B (405.56 kB) of RBAC M2 wave 5: the fixture now exports viborm/rbac (U10), the entry's placement, moves and evidence (U9), and the core growth of E5 and OD-10 (OD-17, measured + 0.3 kB headroom). Raised 405.9 → 406.9 kB by the measured +692 B (406.59 kB) of the independent review's fixes (2026-10-16): the rbac entry's refusals and prover fixes, and the marker judgement in core (OD-17). The permissions rename and conditional-read simplification fixes measure 407,193 B (2026-10-17); limit 407.5 kB follows OD-17 rounding plus 0.3 kB. Raised by the second review's fixes (2026-10-17: typed VALUES rows for judged inserts, caller-text runs in shared-body keys, isolated nesting levels on D1), measured 407.81 kB after the permissions rename; limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Actor admission and polymorphic projection consistency (2026-10-18) measure 409,474 B; limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 410,754 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 411,254 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 415,968 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 418,009 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 422,953 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 427,195 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 428,233 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 428,889 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts (2026-10-22) measure 430,540 B after two bundle-reduction reviews. Owner-approved limit follows rounding up to 0.1 kB plus 0.3 kB headroom; other resource and coverage limits are unchanged. Final prune-review fixes measure 430,609 B and remain within that approved limit. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 429,766 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts merged with shared connect UPDATEs and batched planning reads (2026-10-23) measure 431,468 B together. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 432.54 kB on CI's Node 22.12 build, so 431.8 kB → 432.9 kB under the same OD-17 rule. Keyed snapshot deltas (1.5.0, 2026-10-25: snapshot-delta-2 reading, the named-element encoder and its positional fallback) measure 433,314 B on CI's Node 22.12 and Node 24 builds, so 432.9 kB → 433.7 kB under the same OD-17 rule. 1.5.1 (2026-10-26) measures 434,030 B: provider codes of any SQLSTATE-shaped class kept, a PostgreSQL connection lost under a statement mapped to a retryable ConnectionError, a migration failure keeping its cause's disclosure, and the client symbol migrations read diagnostics through (and, in this bundle, Neki's stepwise migrations, the disclosing migration session and located migration failures); 433.7 kB → 434.4 kB under the same OD-17 rule. viborm/on (2026-10-29) measures 435,652 B: the fixture now exports viborm/on (its entry, its plan and delivery) and core's write-hooks seam; 434.4 kB → 436 kB under the same OD-17 rule. The statements a write hook costs, lowered (2026-10-29): a PostgreSQL upsert keeps its one INSERT … ON CONFLICT and reads its arm from RETURNING (adapter.mutations.upserted, xmax = 0), and without RETURNING a createMany whose rows carry their keys is one INSERT plus one read and a delete with a scalar select locks and reads its rows in one SELECT … FOR UPDATE: measures 435.94 kB; 436 kB → 436.3 kB under the same OD-17 rule. The adversarial review's fixes (2026-10-29: the hooked value cut back before any extension sees it, the upsert arm reported before planning, a probe in the same unit where an adapter has no marker, one failing array hook no longer hiding the next, copied rows and arguments, declarations checked when applied) measure 436.49 kB; 436.3 kB → 436.8 kB under the same OD-17 rule. viborm/on nested writes and onError (2026-10-29: nested rows captured by key in the operation's own unit, nested updateMany/deleteMany from their own RETURNING, a failing hook reported to onError instead of failing its committed write) measures 437.29 kB; 436.8 kB → 437.6 kB under the same OD-17 rule. Raised 437.6 → 438.6 kB by the measured +719 B over the limit (438.32 kB) of #85 (1.6.0) and on()'s reachability gate (measured + 0.3 kB headroom). viborm/ordering (2026-10-31: the entry and its core seam) measures 442.68 kB; 438.6 kB → 443 kB under the same OD-17 rule. The adversarial review's fixes (2026-10-31: respacing as one statement over whole lists, rows named by identity in move, stored keys published instead of their expressions, the filtered MAX for backfilled tables) measure 443.53 kB; 443 kB → 443.9 kB under the same OD-17 rule. The second review's fixes and move in two statements (2026-10-31) measure 444.02 kB; 443.9 kB → 444.4 kB under the same OD-17 rule. The move computed by its UPDATE (2026-10-31: the key expression between.ts builds, the one-statement path, the engine's computed update values) measures 445.62 kB; 444.4 kB → 446 kB under the same OD-17 rule. Extensions next (2026-11-01) measures 446,167 B (+234 B): rows and defaultOmit no longer refused after methods, the scope's chain facts, the soft-delete marker check and purge, ordering's anchor read, the tombstone lock handing its keys to the write; 446 kB → 446.5 kB under the same OD-17 rule. Extensions next, final (2026-11-01) measures 447,514 B: the RowsOf seam and ordering's rekey through the client; 446.5 kB → 447.9 kB under the same OD-17 rule. 1.9.0 (2026-11-02: a policy's tenant and rows.bound, move({ data }), a stamped field skipping the default it replaces) measures 448,117 B on CI's Node 22.12 build; 447.9 kB → 448.5 kB under the same OD-17 rule."
|
|
494
|
+
"limit": "449 kB",
|
|
495
|
+
"message": "Raised 394 → 398.1 kB by the measured +5,700 B (397.74 kB) of RBAC M2 wave 4 (K4 produced rows judged in the statement, K5 evidence and read-gated fields; OD-17, measured + 0.3 kB headroom). Raised 398.1 → 405.9 kB by the measured +7,818 B (405.56 kB) of RBAC M2 wave 5: the fixture now exports viborm/rbac (U10), the entry's placement, moves and evidence (U9), and the core growth of E5 and OD-10 (OD-17, measured + 0.3 kB headroom). Raised 405.9 → 406.9 kB by the measured +692 B (406.59 kB) of the independent review's fixes (2026-10-16): the rbac entry's refusals and prover fixes, and the marker judgement in core (OD-17). The permissions rename and conditional-read simplification fixes measure 407,193 B (2026-10-17); limit 407.5 kB follows OD-17 rounding plus 0.3 kB. Raised by the second review's fixes (2026-10-17: typed VALUES rows for judged inserts, caller-text runs in shared-body keys, isolated nesting levels on D1), measured 407.81 kB after the permissions rename; limit = measured rounded up to 0.1 kB + 0.3 kB (OD-17). Actor admission and polymorphic projection consistency (2026-10-18) measure 409,474 B; limit follows OD-17 rounding to 0.1 kB plus 0.3 kB. Permissions application reuse (2026-10-18) measures 410,754 B: private policy-definition caching, immutable row admission and control-reference reuse. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Cold compilation sharing (2026-10-18) measures 411,254 B: compilation-local structural keys and shared guards in the policy simplifier, and admission that parses and walks each shared sub-predicate once. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.2 (2026-10-19) measures 415,968 B: per-model policy compilation (lazy rows.verbs entries admitted on first use, lazy acyclic, per-chain reference checks), $exists and { $row, up } in row predicates (admission, preparation and lowering frames, shared or correlated bodies, the write re-judgement that reads them), and repeated bodies shared in UPDATE and DELETE statements. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.3.3 (2026-10-19) measures 418,009 B: to-one relation ordering through one LEFT JOIN, the mixed-direction cursor bound, outer-reference chains joined into one EXISTS, merged quantifiers, shared bodies in located lookups, the NOT MATERIALIZED spelling, the upsert refusal's cause; schema validation rules no longer kept (-1.65 kB). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. 1.4.0 (2026-10-20) measures 422,953 B: writes answering relation projections in their own statement, findUnique batching (+1.75 kB), the undefined bulk-where refusal and $extends result computed fields (+2.2 kB), SQLite AS MATERIALIZED nested bodies, single-window distinct, junction-joined many-to-many filters on SQLite. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Neki relation budget (2026-10-21) measures 427,195 B: recursive walks carrying the columns their next hop reads, and past 256 relations a statement's repeated walks as one reaching set and rows joined to the key sets they test, one-column sets held as PostgreSQL arrays (relationsPerStatement: stated, or 256 where a PostgreSQL driver reads Neki from its first connection's startup or first refusal; D1 256). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Nested-write round trips (2026-10-22) measures 428,233 B: a nested write answering its result out of its root statement, a nested root update locating its row in its own UPDATE, and an upsert probe holding the row it finds on PostgreSQL (locksMissingKeys). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. To-many targets read together (2026-10-22) measures 428,889 B: a to-many connect or set reading its targets in one statement and linking them in one INSERT (Selection.rows, linkMany). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts (2026-10-22) measure 430,540 B after two bundle-reduction reviews. Owner-approved limit follows rounding up to 0.1 kB plus 0.3 kB headroom; other resource and coverage limits are unchanged. Final prune-review fixes measure 430,609 B and remain within that approved limit. Shared connect UPDATEs and batched planning reads (2026-10-23) measure 429,766 B: reference-side connect and set targets moved by one UPDATE (updateRows), and on D1 and Neon HTTP a nested write’s planning lookups read in one read-only batch (readTogether). Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. Incremental snapshot artifacts merged with shared connect UPDATEs and batched planning reads (2026-10-23) measure 431,468 B together. Limit follows the approved OD-17 measured rounding to 0.1 kB plus 0.3 kB; resource and coverage limits are unchanged. The 1.4.1 fixes (opt-in findUnique batching in its leader's context, non-null unique selectors, grouped batch-route reads, indexed target matching; 2026-10-24) measure 432.54 kB on CI's Node 22.12 build, so 431.8 kB → 432.9 kB under the same OD-17 rule. Keyed snapshot deltas (1.5.0, 2026-10-25: snapshot-delta-2 reading, the named-element encoder and its positional fallback) measure 433,314 B on CI's Node 22.12 and Node 24 builds, so 432.9 kB → 433.7 kB under the same OD-17 rule. 1.5.1 (2026-10-26) measures 434,030 B: provider codes of any SQLSTATE-shaped class kept, a PostgreSQL connection lost under a statement mapped to a retryable ConnectionError, a migration failure keeping its cause's disclosure, and the client symbol migrations read diagnostics through (and, in this bundle, Neki's stepwise migrations, the disclosing migration session and located migration failures); 433.7 kB → 434.4 kB under the same OD-17 rule. viborm/on (2026-10-29) measures 435,652 B: the fixture now exports viborm/on (its entry, its plan and delivery) and core's write-hooks seam; 434.4 kB → 436 kB under the same OD-17 rule. The statements a write hook costs, lowered (2026-10-29): a PostgreSQL upsert keeps its one INSERT … ON CONFLICT and reads its arm from RETURNING (adapter.mutations.upserted, xmax = 0), and without RETURNING a createMany whose rows carry their keys is one INSERT plus one read and a delete with a scalar select locks and reads its rows in one SELECT … FOR UPDATE: measures 435.94 kB; 436 kB → 436.3 kB under the same OD-17 rule. The adversarial review's fixes (2026-10-29: the hooked value cut back before any extension sees it, the upsert arm reported before planning, a probe in the same unit where an adapter has no marker, one failing array hook no longer hiding the next, copied rows and arguments, declarations checked when applied) measure 436.49 kB; 436.3 kB → 436.8 kB under the same OD-17 rule. viborm/on nested writes and onError (2026-10-29: nested rows captured by key in the operation's own unit, nested updateMany/deleteMany from their own RETURNING, a failing hook reported to onError instead of failing its committed write) measures 437.29 kB; 436.8 kB → 437.6 kB under the same OD-17 rule. Raised 437.6 → 438.6 kB by the measured +719 B over the limit (438.32 kB) of #85 (1.6.0) and on()'s reachability gate (measured + 0.3 kB headroom). viborm/ordering (2026-10-31: the entry and its core seam) measures 442.68 kB; 438.6 kB → 443 kB under the same OD-17 rule. The adversarial review's fixes (2026-10-31: respacing as one statement over whole lists, rows named by identity in move, stored keys published instead of their expressions, the filtered MAX for backfilled tables) measure 443.53 kB; 443 kB → 443.9 kB under the same OD-17 rule. The second review's fixes and move in two statements (2026-10-31) measure 444.02 kB; 443.9 kB → 444.4 kB under the same OD-17 rule. The move computed by its UPDATE (2026-10-31: the key expression between.ts builds, the one-statement path, the engine's computed update values) measures 445.62 kB; 444.4 kB → 446 kB under the same OD-17 rule. Extensions next (2026-11-01) measures 446,167 B (+234 B): rows and defaultOmit no longer refused after methods, the scope's chain facts, the soft-delete marker check and purge, ordering's anchor read, the tombstone lock handing its keys to the write; 446 kB → 446.5 kB under the same OD-17 rule. Extensions next, final (2026-11-01) measures 447,514 B: the RowsOf seam and ordering's rekey through the client; 446.5 kB → 447.9 kB under the same OD-17 rule. 1.9.0 (2026-11-02: a policy's tenant and rows.bound, move({ data }), a stamped field skipping the default it replaces) measures 448,117 B on CI's Node 22.12 build; 447.9 kB → 448.5 kB under the same OD-17 rule. 1.9.1 (2026-11-02: the upsert fold under other models' stamps, ordering's writes keeping updatedAt() and its anchors read by key, softDelete actorId) measures 448.70 kB on CI's Node 22.12 build; 448.5 kB → 449 kB under the same OD-17 rule."
|
|
496
496
|
}
|
|
497
497
|
]
|
|
498
498
|
}
|