Skip to content

Commit e78d743

Browse files
fix(driver-sql): a SQLite array insert past one statement's bounds goes as several INSERTs in one transaction (#38309)
Fixes #38236 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用 SQLite 的应用(本地开发、自托管)一次写入超过五百行时,以前整批报错,现在全部写入;其它数据库无变化。 - 属于数据层的稳定性修复,替用 SQLite 做批量导入、种子数据和批量创建的人解决问题。 - 出错时整批回滚、一行不留,与以前一次写入失败的表现相同;改动只在数据库驱动里,可直接撤回。 - 无 ## What changes `SqlDriver#bulkCreate` sent every batch as ONE INSERT. On SQLite, knex compiles a multi-row INSERT as `insert … select … union all select …`, and SQLite refuses one statement past either of two bounds. Measured on current `main` (9f5562f) with the better-sqlite3 build this package ships (SQLite 3.53.4; `pragma compile_options` lists `MAX_COMPOUND_SELECT=500 MAX_VARIABLE_NUMBER=32766`), binary search per width: | columns | most rows one INSERT took | bound values | refusal at one row more | |:---|:---|:---|:---| | 1 | 500 | 500 | `too many terms in compound SELECT` | | 5 | 500 | 2500 | `too many terms in compound SELECT` | | 20 | 500 | 10000 | `too many terms in compound SELECT` | | 70 | 468 | 32760 | `too many SQL variables` | So the bound is `rows <= 500 AND rows x columns <= 32766`; the row bound binds first up to 65 columns, the variable bound past that. sql.js (the `driver-sqlite-wasm` subclass, SQLite 3.49.1) compiles with the same two values and refuses row 501 the same way. **Who can send a larger array today (non-test):** - REST `POST /data/:object/createMany`: `packages/rest/src/batch-routes.ts:693` caps it at `batch.maxBatchSize`, which `packages/spec/src/api/rest-server.zod.ts:599` allows up to 1000 (default 200); `:700` calls `createManyData`, `packages/metadata-protocol/src/protocol-batch-data.ts:815` calls `engine.insert(object, records)`, and `packages/objectql/src/engine-insert.ts:1553` calls `driver.bulkCreate(object, liveRows)` with the whole array. So an operator who raises the cap past 500 makes `createMany` of 501 to 1000 rows throw on SQLite. - Any in-process `engine.insert(object, rows[])` (plugins, hooks, flows): unbounded; `engine-insert.ts:1553` does not split. - Already bounded below 500: the import runner (`packages/core/src/utils/import-runner.ts:804`, 200), `bulkWrite` (`packages/core/src/utils/bulk-write.ts:99`, default 200, a caller may pass more), the seed loader (`packages/metadata-protocol/src/seed-loader.ts:4369`, 200). **The fix** (`packages/drivers/driver-sql/src/sql-driver-bulk-operations.ts`): on SQLite, a batch past either bound goes as several INSERTs, in row order, inside ONE transaction; under a caller's `options.transaction`, a savepoint of it (the runner idiom `bulkUpdate` already uses). The guarantees the `bulkCreate` comment states hold for the split batch: - all-or-nothing: a failing statement rolls back the statements before it; - the auto-number reservation is taken once, for the whole batch, by the existing loop, BEFORE the transaction opens, and dealt in row order; the transaction holds only the INSERTs, so it never waits on a reservation's own connection (the SQLite pool-of-one deadlock the comment names); - a failed batch burns its reserved numbers exactly as a failed single INSERT does, and the collision retry re-issues the whole batch, as before. A batch within both bounds is sent exactly as before: one INSERT, no transaction. Other dialects are not split. The comment block in `bulkCreate` gains a section saying all of this. No refusal is added, so nothing a caller may send changes: `Metadata-protocol: none` holds. "On SQLite" is asked of knex's client (`compilesSqliteInsert`: `knex.client.dialect === 'sqlite3'`), because knex's SQLite compiler is what emits the bounded `union all` form. Measured: `better-sqlite3` reports `sqlite3`; `pg`, `mysql2`, `mssql`, `oracledb` report `postgresql`, `mysql`, `mssql`, `oracle`; the sql.js client of `driver-sqlite-wasm` is `class Client_WasmSqlite extends Client_SQLite3` and does not rename the dialect, and Turso's local mode is spelled `better-sqlite3`. So the split reaches the same three drivers `isSqlite` names, without a host member: `sql-driver.ts` is a facade at its line ceiling (`check:facade-delegation-only`, 10071 of 10071), and the first cut of this branch, which added `get isSqlite()` to the facet host there, went red on that gate by one line. This diff does not touch `sql-driver.ts`. ## Tests New `packages/drivers/driver-sql/src/sql-driver-38236-sqlite-bulk-insert-bound.test.ts` (13 tests), against better-sqlite3 in memory: - a 1200-row x 6-column batch inserts every row, in order, as 3 INSERTs that sit between ONE `BEGIN` and ONE `COMMIT`; - a 450-row x 80-column batch (under 500 rows, past 32766 values) splits and lands; - auto-numbers across the 1200 rows are `T-00001` to `T-01200`, contiguous and in row order, stored and answered, counter at 1200; - a 1200-row batch whose row 1150 (third statement) repeats an id leaves 0 rows stored; the counter moves by 1200, exactly as the 3-row single-statement CONTROL moves it by 3; the next batch continues at `T-01204` with no duplicate; - under a caller's transaction: the caller's rollback removes all 1200 rows; a failed split batch is undone and the caller's own earlier write survives its commit; - CONTROL: a 500-row batch is ONE INSERT, preceded by the reservations' own `COMMIT` and followed by nothing (no transaction opened around it); 501 rows is two INSERTs; - three unit pins on `sqliteInsertStatements` (one array kept as is within both bounds; every statement within both bounds for 1200x6, 450x80, 100x2000, 501x1; a column only one row carries counts for every row); - two pins on `compilesSqliteInsert`: true for `better-sqlite3`, false for `pg`, `mysql2`, `mssql`, `oracledb` (other dialects are never split); true for a client class extending knex's SQLite client (the sql.js driver's shape). <details><summary>Pins red without the fix (scripts/ablation-replace.mjs)</summary> Mutation, on head a51d057: `const statements = compilesSqliteInsert(this.knex) ? sqliteInsertStatements(formattedRows) : [formattedRows];` replaced by `const statements = [formattedRows];` (the pre-fix single statement). The suite imports the driver from `src/`, so no build sits between the mutation and the run. ``` ablation-replace: ok mutation landed: anchor 1 -> 0, blob 3131297 -> 82f60ca228e2 x inserts every row of a 1200-row batch, in order, as statements within both bounds x splits a wide batch by the parameter bound even under 500 rows x deals the batch's auto-numbers contiguously and in row order across statements x leaves nothing stored when the LAST statement fails, and burns the reservation once, as one statement does x runs inside the caller's transaction: the caller's rollback removes every statement's rows x undoes a failed split batch inside the caller's transaction and keeps the caller's own writes ok CONTROL: a batch at the bound is still ONE statement with no transaction opened x one row past the bound is two statements ok (3 sqliteInsertStatements pins, 2 compilesSqliteInsert pins) Tests 7 failed | 6 passed (13) ablation-replace: ok restored: blob == HEAD (3131297) and `git diff HEAD` is empty ``` Red reasons in the log: `too many terms in compound SELECT` (4), `too many SQL variables` (1, the wide batch); the two caller-transaction pins fail on the same refusal and then time out in teardown on the transaction left open. </details> <details><summary>Package suite and typecheck</summary> `pnpm --filter @objectstack/driver-sql typecheck && pnpm --filter @objectstack/driver-sql test` under the verify lock: `VERDICT command-exit 0`; `Test Files 272 passed | 14 skipped (286)`, `Tests 4582 passed | 265 skipped (4847)`, on head a51d057. The package `typecheck` (`tsc --noEmit`) lists the new test file (`--listFiles`: 1 hit). Live PostgreSQL and MySQL were not run locally (no URLs set); they are untouched by this diff, which splits only on SQLite. </details> <details><summary>Derived gate families, run locally on head a51d057</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 65 commands from the tree at a51d057; each was run with its exit code captured before any pipe; `--ran` reconciles `65 derived, 65 run, 0 UNRUN`. - exit 0: 62 of 65, among them `check:durability-log-level`, `check:tenant-chokepoint`, `check:driver-conformance`, `check:published-files`, `check:nul-bytes`, `check:changeset-no-major`, `check:empty-changeset`, `check:adr-0087-registration`. - NOT MEASURED locally, exit 3 (PREREQUISITE NOT MET, so nothing was measured); CI runs each on a full checkout and build: - `node scripts/check-plugin-teardown-shape.mjs --self-test`: its fixture is pinned to a commit this shallow clone lacks - `pnpm check:dual-build-cjs-loads`: it loads the built entry points of every package, and only the driver-sql closure is built here - `pnpm check:lean-entry-closure`: it loads built entry points (`@objectstack/objectql` is not built here) - exit 1: none. - Outside the derivation, because the final diff no longer touches `sql-driver.ts`: `pnpm check:facade-delegation-only` exit 0 on a51d057 (`sql-driver.ts: 10071 lines, ceiling 10071 (0 left; ruling 6897467376)`). It is the gate that refused this branch's first cut by one line. </details> ## Acceptance notes - File surface: exactly the claim's: `sql-driver-bulk-operations.ts`, one co-located test file, one changeset. `sql-driver.ts` and `sql-driver-schema-sync.ts` are not touched. - The two bounds are SQLite's compile-time defaults, written as constants (`SQLITE_MAX_INSERT_ROWS`, `SQLITE_MAX_INSERT_VARIABLES`), not read at runtime: better-sqlite3 does not expose `sqlite3_limit`, and both builds this repository ships (better-sqlite3, sql.js) compile with these values. A build compiled LOWER would still refuse; none ships here. - The column count is the union of the rows' keys (knex binds every column of the union for every row); an overcount only makes a statement smaller. ## Verification Files to read first: `packages/drivers/driver-sql/src/sql-driver-bulk-operations.ts` (the `try` block in `bulkCreate`: the one-statement branch must send the same single INSERT, through the same RETURNING or read-back, as before), then the new test file. Two-minute check: `pnpm --filter @objectstack/driver-sql exec vitest run src/sql-driver-38236-sqlite-bulk-insert-bound.test.ts` shows `Tests 13 passed (13)`. --- _Generated by [Claude Code](https://claude.ai/code/session_017xRBcVXco8T2suSgnRk52Y)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent a7e60c7 commit e78d743

3 files changed

Lines changed: 368 additions & 8 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@objectstack/driver-sql': patch
3+
---
4+
5+
fix(driver-sql): an array insert of more than 500 rows no longer throws on SQLite
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`engine.insert(object, rows)` hands an array to the driver's `bulkCreate`, which sent the whole batch as one INSERT. SQLite refuses one INSERT past either of two bounds: 500 rows (`too many terms in compound SELECT`) or 32766 bound values, rows times columns (`too many SQL variables`, reached first on an object of more than 65 columns). So a batch past them threw on SQLite and on no other dialect. A REST `createMany` reaches it when `batch.maxBatchSize` is raised above 500 (it allows up to 1000), and so does any in-process `insert` of a larger array.
11+
12+
On SQLite, a batch past either bound now goes as several INSERTs, in row order, inside one transaction (a savepoint of the caller's transaction when one is passed). The batch keeps every guarantee it had: all rows land or none do, the auto-number values are reserved once for the whole batch before the transaction opens and are dealt in row order, and a failed batch burns its reserved numbers exactly as a failed single INSERT does. A batch within both bounds is still sent as one INSERT with no transaction, and other dialects are unchanged.
13+
14+
What to do: nothing. Callers that split their own arrays to stay under 500 rows on SQLite may stop.
Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
2+
3+
/**
4+
* [#38236] `bulkCreate` on SQLite past one INSERT statement's bounds.
5+
*
6+
* knex compiles a multi-row INSERT on SQLite as `insert … select … union all
7+
* select …`, and SQLite refuses one statement past either of two bounds,
8+
* measured on the better-sqlite3 build this package ships (SQLite 3.53.4):
9+
*
10+
* | bound | value | first refused batch | SQLite's words |
11+
* |:---|:---|:---|:---|
12+
* | `SQLITE_MAX_COMPOUND_SELECT` | 500 terms | 501 rows, any width | `too many terms in compound SELECT` |
13+
* | `SQLITE_MAX_VARIABLE_NUMBER` | 32766 parameters | 469 rows of 70 columns | `too many SQL variables` |
14+
*
15+
* Before this change the driver sent every batch as one INSERT, so
16+
* `engine.insert(object, rows)` with more than 500 rows threw on SQLite and
17+
* on no other dialect. It now sends such a batch as several INSERTs inside one
18+
* transaction. These pins hold the guarantees `bulkCreate` states for a batch
19+
* to the split one: every row lands, a failing statement leaves nothing stored,
20+
* the auto-number reservation is the batch's one reservation dealt in row
21+
* order, and a batch that fits one statement is still exactly one statement.
22+
*/
23+
24+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
25+
import { SqlDriver } from './index.js';
26+
import knexFactory from 'knex';
27+
import { SQLITE_MAX_INSERT_ROWS, SQLITE_MAX_INSERT_VARIABLES, compilesSqliteInsert, sqliteInsertStatements } from './sql-driver-bulk-operations.js';
28+
29+
const SEQUENCES_TABLE = '_objectstack_sequences';
30+
31+
const TICKET = {
32+
name: 'bound_ticket',
33+
fields: {
34+
ticket_number: { type: 'autonumber', format: 'T-{00000}', unique: true },
35+
title: { type: 'string' },
36+
priority: { type: 'number' },
37+
status: { type: 'string' },
38+
owner: { type: 'string' },
39+
notes: { type: 'text' },
40+
},
41+
} as any;
42+
43+
/** 80 declared columns: a batch of 450 binds 36000+ parameters, past 32766, while under 500 rows. */
44+
const WIDE = {
45+
name: 'bound_wide',
46+
fields: Object.fromEntries(Array.from({ length: 80 }, (_, i) => [`c${i}`, { type: 'string' }])),
47+
} as any;
48+
49+
const ticketRows = (n: number, from = 0) =>
50+
Array.from({ length: n }, (_, i) => ({
51+
id: `t${String(from + i).padStart(5, '0')}`,
52+
title: `ticket ${from + i}`,
53+
priority: (from + i) % 5,
54+
status: 'open',
55+
owner: 'ops',
56+
notes: 'n',
57+
}));
58+
59+
describe('[#38236] bulkCreate on SQLite past one INSERT statement\'s bounds', () => {
60+
let driver: SqlDriver;
61+
/** The SQL of every statement the driver sent to the object's table, in order. */
62+
let sent: string[];
63+
64+
const knex = () => (driver as any).knex;
65+
const insertsInto = (table: string) => sent.filter((sql) => sql.startsWith(`insert into \`${table}\``));
66+
const rowCount = async (table: string) => Number((await knex()(table).count({ c: '*' }).first()).c);
67+
const lastValue = async (): Promise<number | undefined> => {
68+
const row = (await knex()(SEQUENCES_TABLE).select('*')).find((r: any) => r.object === TICKET.name && r.field === 'ticket_number');
69+
return row ? Number(row.last_value) : undefined;
70+
};
71+
72+
beforeEach(async () => {
73+
driver = new SqlDriver({ client: 'better-sqlite3', connection: { filename: ':memory:' }, useNullAsDefault: true });
74+
await driver.initObjects([TICKET, WIDE]);
75+
sent = [];
76+
knex().on('query', (q: { sql: string }) => sent.push(q.sql.trim().toLowerCase()));
77+
});
78+
79+
afterEach(async () => {
80+
await driver.disconnect();
81+
});
82+
83+
it('inserts every row of a 1200-row batch, in order, as statements within both bounds', async () => {
84+
const rows = ticketRows(1200);
85+
const result = await driver.bulkCreate(TICKET.name, rows);
86+
const statements = [...sent];
87+
88+
expect(result).toHaveLength(1200);
89+
expect(result.map((r) => r.id)).toEqual(rows.map((r) => r.id));
90+
expect(await rowCount(TICKET.name)).toBe(1200);
91+
// 500 + 500 + 200: the compound-SELECT bound is the one that binds here.
92+
expect(insertsInto(TICKET.name)).toHaveLength(3);
93+
// All three inside ONE transaction: the reservations are all taken before
94+
// it opens, so it holds the three INSERTs and nothing else.
95+
const first = statements.findIndex((sql) => sql.startsWith(`insert into \`${TICKET.name}\``));
96+
expect(statements.slice(first - 1)).toEqual(['begin;', ...insertsInto(TICKET.name), 'commit;']);
97+
});
98+
99+
it('splits a wide batch by the parameter bound even under 500 rows', async () => {
100+
const rows = Array.from({ length: 450 }, (_, r) => ({
101+
id: `w${r}`,
102+
...Object.fromEntries(Array.from({ length: 80 }, (_, i) => [`c${i}`, `v${r}-${i}`])),
103+
}));
104+
const result = await driver.bulkCreate(WIDE.name, rows);
105+
106+
expect(result).toHaveLength(450);
107+
expect(await rowCount(WIDE.name)).toBe(450);
108+
expect(insertsInto(WIDE.name).length).toBeGreaterThan(1);
109+
expect(result[449].c79).toBe('v449-79');
110+
});
111+
112+
it('deals the batch\'s auto-numbers contiguously and in row order across statements', async () => {
113+
const result = await driver.bulkCreate(TICKET.name, ticketRows(1200));
114+
115+
const expected = Array.from({ length: 1200 }, (_, i) => `T-${String(i + 1).padStart(5, '0')}`);
116+
expect(result.map((r) => r.ticket_number)).toEqual(expected);
117+
const stored = await knex()(TICKET.name).select('id', 'ticket_number').orderBy('id');
118+
expect(stored.map((r: any) => r.ticket_number)).toEqual(expected);
119+
expect(await lastValue()).toBe(1200);
120+
});
121+
122+
it('leaves nothing stored when the LAST statement fails, and burns the reservation once, as one statement does', async () => {
123+
// CONTROL: a 3-row batch refused as one statement. The driver documents the
124+
// shape: no row stored, the reserved numbers burned (they commit on purpose).
125+
const control = ticketRows(3, 9000);
126+
control[2].id = control[0].id;
127+
await expect(driver.bulkCreate(TICKET.name, control)).rejects.toThrow(/UNIQUE constraint failed: bound_ticket\.id/);
128+
expect(await rowCount(TICKET.name)).toBe(0);
129+
expect(await lastValue()).toBe(3);
130+
131+
// A 1200-row batch whose row 1150 (in the third statement) repeats row 5's id.
132+
const rows = ticketRows(1200);
133+
rows[1150].id = rows[5].id;
134+
await expect(driver.bulkCreate(TICKET.name, rows)).rejects.toThrow(/UNIQUE constraint failed: bound_ticket\.id/);
135+
expect(insertsInto(TICKET.name).length).toBeGreaterThanOrEqual(4); // the control's one, then the split batch's three
136+
expect(await rowCount(TICKET.name)).toBe(0);
137+
// Burned once for the whole batch, exactly as the control burned its three.
138+
expect(await lastValue()).toBe(3 + 1200);
139+
140+
// The next batch continues above the burned range, with no duplicate.
141+
const next = await driver.bulkCreate(TICKET.name, ticketRows(2, 9500));
142+
expect(next.map((r) => r.ticket_number)).toEqual(['T-01204', 'T-01205']);
143+
});
144+
145+
it('runs inside the caller\'s transaction: the caller\'s rollback removes every statement\'s rows', async () => {
146+
const trx = await knex().transaction();
147+
const result = await driver.bulkCreate(TICKET.name, ticketRows(1200), { transaction: trx } as any);
148+
expect(result).toHaveLength(1200);
149+
expect(Number((await trx(TICKET.name).count({ c: '*' }).first()).c)).toBe(1200);
150+
await trx.rollback();
151+
expect(await rowCount(TICKET.name)).toBe(0);
152+
});
153+
154+
it('undoes a failed split batch inside the caller\'s transaction and keeps the caller\'s own writes', async () => {
155+
const trx = await knex().transaction();
156+
await driver.bulkCreate(TICKET.name, ticketRows(1, 7000), { transaction: trx } as any);
157+
const rows = ticketRows(1200);
158+
rows[1150].id = rows[5].id;
159+
await expect(driver.bulkCreate(TICKET.name, rows, { transaction: trx } as any)).rejects.toThrow(/UNIQUE constraint failed/);
160+
expect(Number((await trx(TICKET.name).count({ c: '*' }).first()).c)).toBe(1);
161+
await trx.commit();
162+
expect(await rowCount(TICKET.name)).toBe(1);
163+
});
164+
165+
it('CONTROL: a batch at the bound is still ONE statement with no transaction opened', async () => {
166+
const result = await driver.bulkCreate(TICKET.name, ticketRows(500));
167+
168+
expect(result).toHaveLength(500);
169+
expect(insertsInto(TICKET.name)).toHaveLength(1);
170+
// Each row's reservation commits in its own transaction first; the INSERT
171+
// follows the last of those COMMITs and is the last statement sent, so no
172+
// transaction is opened around it.
173+
const at = sent.findIndex((sql) => sql.startsWith(`insert into \`${TICKET.name}\``));
174+
expect(sent[at - 1]).toBe('commit;');
175+
expect(at).toBe(sent.length - 1);
176+
});
177+
178+
it('one row past the bound is two statements', async () => {
179+
await driver.bulkCreate(TICKET.name, ticketRows(501));
180+
expect(insertsInto(TICKET.name)).toHaveLength(2);
181+
expect(await rowCount(TICKET.name)).toBe(501);
182+
});
183+
});
184+
185+
describe('[#38236] sqliteInsertStatements', () => {
186+
const rowsOf = (n: number, width: number) =>
187+
Array.from({ length: n }, () => Object.fromEntries(Array.from({ length: width }, (_, i) => [`c${i}`, 1])));
188+
189+
it('keeps a batch within both bounds as the one array it was given', () => {
190+
const rows = rowsOf(SQLITE_MAX_INSERT_ROWS, 5);
191+
const statements = sqliteInsertStatements(rows);
192+
expect(statements).toHaveLength(1);
193+
expect(statements[0]).toBe(rows);
194+
});
195+
196+
it('bounds every statement by rows and by rows times the union of columns', () => {
197+
for (const [n, width] of [[1200, 6], [450, 80], [100, 2000], [501, 1]] as const) {
198+
const rows = rowsOf(n, width);
199+
const statements = sqliteInsertStatements(rows);
200+
expect(statements.flat()).toEqual(rows);
201+
for (const s of statements) {
202+
expect(s.length).toBeLessThanOrEqual(SQLITE_MAX_INSERT_ROWS);
203+
expect(s.length * width).toBeLessThanOrEqual(SQLITE_MAX_INSERT_VARIABLES);
204+
}
205+
}
206+
});
207+
208+
it('counts a column any row carries against every row', () => {
209+
// 469 rows: 468 carry 69 columns, the last carries a 70th. knex binds all 70 for each row.
210+
const rows = rowsOf(469, 69);
211+
(rows[468] as any).c69 = 1;
212+
expect(sqliteInsertStatements(rows).length).toBeGreaterThan(1);
213+
});
214+
});
215+
216+
describe('[#38236] compilesSqliteInsert: only knex\'s SQLite compiler is split', () => {
217+
it('answers true for the SQLite family and false for every other dialect this driver speaks', async () => {
218+
const answers: Record<string, boolean> = {};
219+
for (const client of ['better-sqlite3', 'pg', 'mysql2', 'mssql', 'oracledb']) {
220+
// No connection is opened: knex resolves the dialect when the instance is built.
221+
const k = knexFactory({ client, connection: client === 'better-sqlite3' ? { filename: ':memory:' } : {}, useNullAsDefault: true });
222+
answers[client] = compilesSqliteInsert(k);
223+
await k.destroy();
224+
}
225+
expect(answers).toEqual({ 'better-sqlite3': true, pg: false, mysql2: false, mssql: false, oracledb: false });
226+
});
227+
228+
it('answers true for a client class that extends knex\'s SQLite client, the shape the sql.js driver passes', async () => {
229+
const Base = (knexFactory({ client: 'better-sqlite3', connection: { filename: ':memory:' }, useNullAsDefault: true }) as any).client.constructor;
230+
class Client_Custom extends Base {}
231+
const k = knexFactory({ client: Client_Custom as any, connection: { filename: ':memory:' }, useNullAsDefault: true });
232+
expect(compilesSqliteInsert(k)).toBe(true);
233+
await k.destroy();
234+
});
235+
});

0 commit comments

Comments
 (0)