@pikku/kysely-node-sqlite 0.12.8 → 0.12.9
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @pikku/kysely-node-sqlite
|
|
2
2
|
|
|
3
|
+
## 0.12.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1fe79bc: A standalone build of a SQLite app now ships its `db.sqliteExtensions` (sqlite-vec's vec0 by default) inside the artifact, so a migration or query that uses them works in production the way it does under `pikku dev`. The node bundle loads them from `sqlite-extensions/` beside itself; a compiled bun binary embeds them and writes them out under `$PIKKU_DATA_DIR/.pikku-sqlite-extensions/` on start. The libraries are the build machine's, so an extension that cannot be resolved there fails the build; `[]` builds without them.
|
|
8
|
+
|
|
9
|
+
`createNodeSqliteKysely` and `createBunSqliteKysely` take an `extensions` list of library paths to load into the connection.
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [1394385]
|
|
12
|
+
- Updated dependencies [7740547]
|
|
13
|
+
- @pikku/core@0.12.124
|
|
14
|
+
- @pikku/kysely-sqlite@0.12.15
|
|
15
|
+
|
|
3
16
|
## 0.12.8
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -16,5 +16,11 @@ export interface CreateNodeSqliteKyselyOptions {
|
|
|
16
16
|
* register functions. Using it is a decision to stay on Node.
|
|
17
17
|
*/
|
|
18
18
|
functions?: SqliteFunctionMap;
|
|
19
|
+
/**
|
|
20
|
+
* Absolute paths of loadable SQLite extensions (sqlite-vec's `vec0`, say) to
|
|
21
|
+
* load before the database is handed to Kysely. Loaded through the C API;
|
|
22
|
+
* SQL's own `load_extension()` stays refused.
|
|
23
|
+
*/
|
|
24
|
+
extensions?: string[];
|
|
19
25
|
}
|
|
20
26
|
export declare function createNodeSqliteKysely<DB>(options: CreateNodeSqliteKyselyOptions): Kysely<DB>;
|
|
@@ -3,7 +3,17 @@ import { Kysely, SqliteDialect, CamelCasePlugin, } from 'kysely';
|
|
|
3
3
|
import { NodeSqliteDatabase } from './node-sqlite-adapter.js';
|
|
4
4
|
import { registerSqliteFunctions } from './register-functions.js';
|
|
5
5
|
export function createNodeSqliteKysely(options) {
|
|
6
|
-
const
|
|
6
|
+
const extensions = options.extensions ?? [];
|
|
7
|
+
// node:sqlite refuses loadExtension on a connection not opened allowing it,
|
|
8
|
+
// so allow it only when there is something to load, and shut it again after.
|
|
9
|
+
const db = new DatabaseSync(options.filename, {
|
|
10
|
+
allowExtension: extensions.length > 0,
|
|
11
|
+
});
|
|
12
|
+
if (extensions.length > 0) {
|
|
13
|
+
for (const path of extensions)
|
|
14
|
+
db.loadExtension(path);
|
|
15
|
+
db.enableLoadExtension(false);
|
|
16
|
+
}
|
|
7
17
|
if (options.functions)
|
|
8
18
|
registerSqliteFunctions(db, options.functions);
|
|
9
19
|
const plugins = [];
|
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.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pikkujs/pikku.git",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@pikku/kysely": "^0.13.25",
|
|
29
|
-
"@pikku/kysely-sqlite": "^0.12.
|
|
29
|
+
"@pikku/kysely-sqlite": "^0.12.15",
|
|
30
30
|
"kysely": "^0.29.5"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@pikku/core": "^0.12.
|
|
33
|
+
"@pikku/core": "^0.12.124"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@pikku/core": "^0.12.
|
|
36
|
+
"@pikku/core": "^0.12.124",
|
|
37
37
|
"@types/node": "^22",
|
|
38
38
|
"tsx": "^4.23.12"
|
|
39
39
|
},
|