@pikku/kysely-sqlite 0.12.14 → 0.12.15

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,31 @@
1
1
  # @pikku/kysely-sqlite
2
2
 
3
+ ## 0.12.15
4
+
5
+ ### Patch Changes
6
+
7
+ - 7740547: Let the SQLite and D1 Kysely factories take extra plugins, and stop the fabric
8
+ coercion check from missing a bool-only map.
9
+
10
+ `createNodeSqliteKysely` and `createBunSqliteKysely` both accept a `plugins`
11
+ array, which is how the generated `coercionMap` reaches a Kysely instance.
12
+ `createSQLiteKysely` and `createD1Kysely` did not: they hard-coded their plugin
13
+ array, so the one instance a deployed Cloudflare Worker builds had no way to
14
+ apply the coercion the CLI generates. They now take an options object with
15
+ `plugins`, layered ahead of `SerializePlugin`, which has to stay last, and
16
+ `@pikku/kysely-sqlite` re-exports `createCoercionPlugin` and `CoercionMap` the
17
+ way `@pikku/kysely-node-sqlite` already did, so a worker that only depends on
18
+ the SQLite package can build the plugin.
19
+
20
+ The fabric `coercion-map-not-wired` check tested the generated file for
21
+ `"date" | "boolean" | "json"`, but the codegen emits `bool`, never `boolean`. A
22
+ project whose only annotated columns were booleans passed the check with the map
23
+ unwired — exactly the case that is invisible locally, since the dev driver
24
+ returns `true` where a deployed stage returns `1`.
25
+
26
+ - Updated dependencies [1394385]
27
+ - @pikku/core@0.12.124
28
+
3
29
  ## 0.12.14
4
30
 
5
31
  ### Patch Changes
@@ -1,3 +1,7 @@
1
- import { Kysely, type SqliteDatabase } from 'kysely';
1
+ import { Kysely, type KyselyPlugin, type SqliteDatabase } from 'kysely';
2
2
  import type { KyselyPikkuDB } from '@pikku/kysely';
3
- export declare function createSQLiteKysely(database: SqliteDatabase | (() => Promise<SqliteDatabase>)): Kysely<KyselyPikkuDB>;
3
+ export interface CreateSQLiteKyselyOptions {
4
+ /** Extra plugins to layer on, ahead of the always-last SerializePlugin. */
5
+ plugins?: KyselyPlugin[];
6
+ }
7
+ export declare function createSQLiteKysely(database: SqliteDatabase | (() => Promise<SqliteDatabase>), options?: CreateSQLiteKyselyOptions): Kysely<KyselyPikkuDB>;
@@ -1,8 +1,8 @@
1
- import { Kysely, SqliteDialect } from 'kysely';
1
+ import { Kysely, SqliteDialect, } from 'kysely';
2
2
  import { SerializePlugin } from '@pikku/kysely';
3
- export function createSQLiteKysely(database) {
3
+ export function createSQLiteKysely(database, options = {}) {
4
4
  return new Kysely({
5
5
  dialect: new SqliteDialect({ database }),
6
- plugins: [new SerializePlugin()],
6
+ plugins: [...(options.plugins ?? []), new SerializePlugin()],
7
7
  });
8
8
  }
@@ -1,4 +1,4 @@
1
- export { createSQLiteKysely } from './create-sqlite-kysely.js';
1
+ export { createSQLiteKysely, type CreateSQLiteKyselyOptions, } from './create-sqlite-kysely.js';
2
2
  export { SQLiteKyselyWorkflowService } from './sqlite-kysely-workflow-service.js';
3
3
  export { SQLiteKyselyDeploymentService } from './sqlite-kysely-deployment-service.js';
4
4
  export { SQLiteKyselyAgentStorageService } from './sqlite-kysely-agent-storage-service.js';
@@ -9,6 +9,7 @@ export { SQLiteKyselyEventHubStore } from './sqlite-kysely-eventhub-store.js';
9
9
  export { SQLiteKyselySecretService } from './sqlite-kysely-secret-service.js';
10
10
  export { SqliteFunctionsUnsupportedError, type SqliteFunctionMap, } from './sqlite-functions.js';
11
11
  export { LibsqlWebDialect } from './libsql-web-dialect.js';
12
+ export { createCoercionPlugin, type ColumnKind, type CoercionMap, type CreateCoercionPluginOptions, } from '@pikku/kysely';
12
13
  export type { KyselyPikkuDB } from '@pikku/kysely';
13
14
  export type { WorkflowRunService } from '@pikku/core/workflow';
14
15
  export type { AgentRunService, AgentRunRow } from '@pikku/core/agent';
package/dist/src/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { createSQLiteKysely } from './create-sqlite-kysely.js';
1
+ export { createSQLiteKysely, } from './create-sqlite-kysely.js';
2
2
  export { SQLiteKyselyWorkflowService } from './sqlite-kysely-workflow-service.js';
3
3
  export { SQLiteKyselyDeploymentService } from './sqlite-kysely-deployment-service.js';
4
4
  export { SQLiteKyselyAgentStorageService } from './sqlite-kysely-agent-storage-service.js';
@@ -9,3 +9,4 @@ export { SQLiteKyselyEventHubStore } from './sqlite-kysely-eventhub-store.js';
9
9
  export { SQLiteKyselySecretService } from './sqlite-kysely-secret-service.js';
10
10
  export { SqliteFunctionsUnsupportedError, } from './sqlite-functions.js';
11
11
  export { LibsqlWebDialect } from './libsql-web-dialect.js';
12
+ export { createCoercionPlugin, } from '@pikku/kysely';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/kysely-sqlite",
3
- "version": "0.12.14",
3
+ "version": "0.12.15",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -26,10 +26,10 @@
26
26
  "kysely": "^0.29.5"
27
27
  },
28
28
  "peerDependencies": {
29
- "@pikku/core": "^0.12.108"
29
+ "@pikku/core": "^0.12.124"
30
30
  },
31
31
  "devDependencies": {
32
- "@pikku/core": "^0.12.108"
32
+ "@pikku/core": "^0.12.124"
33
33
  },
34
34
  "exports": {
35
35
  ".": "./dist/src/index.js"