@pikku/kysely-node-sqlite 0.12.10 → 0.12.11
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Kysely, type KyselyPlugin } from 'kysely';
|
|
2
|
+
import { type TraceDriverOptions } from '@pikku/kysely';
|
|
2
3
|
import type { SqliteFunctionMap } from '@pikku/kysely-sqlite';
|
|
3
|
-
export interface CreateNodeSqliteKyselyOptions {
|
|
4
|
+
export interface CreateNodeSqliteKyselyOptions extends Omit<TraceDriverOptions, 'system'> {
|
|
4
5
|
/** Path to the SQLite file. Use ':memory:' for an in-memory DB. */
|
|
5
6
|
filename: string;
|
|
6
7
|
/** Apply CamelCasePlugin so DB columns map to camelCase TS fields. Default true. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
import { Kysely, SqliteDialect, CamelCasePlugin, } from 'kysely';
|
|
3
|
+
import { traceDialect } from '@pikku/kysely';
|
|
3
4
|
import { NodeSqliteDatabase } from './node-sqlite-adapter.js';
|
|
4
5
|
import { registerSqliteFunctions } from './register-functions.js';
|
|
5
6
|
export function createNodeSqliteKysely(options) {
|
|
@@ -22,7 +23,12 @@ export function createNodeSqliteKysely(options) {
|
|
|
22
23
|
if (options.plugins)
|
|
23
24
|
plugins.push(...options.plugins);
|
|
24
25
|
return new Kysely({
|
|
25
|
-
dialect: new SqliteDialect({ database: new NodeSqliteDatabase(db) }),
|
|
26
|
+
dialect: traceDialect(new SqliteDialect({ database: new NodeSqliteDatabase(db) }), {
|
|
27
|
+
tracer: options.tracer,
|
|
28
|
+
currentTrace: options.currentTrace,
|
|
29
|
+
recordSqlText: options.recordSqlText,
|
|
30
|
+
system: 'sqlite',
|
|
31
|
+
}),
|
|
26
32
|
plugins,
|
|
27
33
|
});
|
|
28
34
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/kysely-node-sqlite",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.11",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pikkujs/pikku.git",
|
|
@@ -26,15 +26,15 @@
|
|
|
26
26
|
"node": ">=22.10"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@pikku/kysely": "^0.13.
|
|
30
|
-
"@pikku/kysely-sqlite": "^0.12.
|
|
29
|
+
"@pikku/kysely": "^0.13.43",
|
|
30
|
+
"@pikku/kysely-sqlite": "^0.12.19",
|
|
31
31
|
"kysely": "^0.29.6"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@pikku/core": "^0.12.
|
|
34
|
+
"@pikku/core": "^0.12.156"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@pikku/core": "^0.12.
|
|
37
|
+
"@pikku/core": "^0.12.156",
|
|
38
38
|
"@types/node": "^26",
|
|
39
39
|
"tsx": "^4.23.15"
|
|
40
40
|
},
|