@pikku/kysely-sqlite 0.12.14 → 0.12.16

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,43 @@
1
1
  # @pikku/kysely-sqlite
2
2
 
3
+ ## 0.12.16
4
+
5
+ ### Patch Changes
6
+
7
+ - a16b0ba: Persistent workflow services take a required `leaseService` (`WorkflowServiceOptions`) and lock runs and steps on it. The Postgres advisory and MySQL `GET_LOCK` step locks, and Redis's own `SET NX` run and step locks, are removed; `RedisWorkflowService` now takes `(connection, { leaseService, keyPrefix? })`.
8
+ - Updated dependencies [a16b0ba]
9
+ - Updated dependencies [21e9c3a]
10
+ - Updated dependencies [a16b0ba]
11
+ - Updated dependencies [a16b0ba]
12
+ - @pikku/core@0.12.133
13
+ - @pikku/kysely@0.13.33
14
+
15
+ ## 0.12.15
16
+
17
+ ### Patch Changes
18
+
19
+ - 7740547: Let the SQLite and D1 Kysely factories take extra plugins, and stop the fabric
20
+ coercion check from missing a bool-only map.
21
+
22
+ `createNodeSqliteKysely` and `createBunSqliteKysely` both accept a `plugins`
23
+ array, which is how the generated `coercionMap` reaches a Kysely instance.
24
+ `createSQLiteKysely` and `createD1Kysely` did not: they hard-coded their plugin
25
+ array, so the one instance a deployed Cloudflare Worker builds had no way to
26
+ apply the coercion the CLI generates. They now take an options object with
27
+ `plugins`, layered ahead of `SerializePlugin`, which has to stay last, and
28
+ `@pikku/kysely-sqlite` re-exports `createCoercionPlugin` and `CoercionMap` the
29
+ way `@pikku/kysely-node-sqlite` already did, so a worker that only depends on
30
+ the SQLite package can build the plugin.
31
+
32
+ The fabric `coercion-map-not-wired` check tested the generated file for
33
+ `"date" | "boolean" | "json"`, but the codegen emits `bool`, never `boolean`. A
34
+ project whose only annotated columns were booleans passed the check with the map
35
+ unwired — exactly the case that is invisible locally, since the dev driver
36
+ returns `true` where a deployed stage returns `1`.
37
+
38
+ - Updated dependencies [1394385]
39
+ - @pikku/core@0.12.124
40
+
3
41
  ## 0.12.14
4
42
 
5
43
  ### Patch Changes
package/README.md CHANGED
@@ -20,13 +20,20 @@ import {
20
20
  createSQLiteKysely,
21
21
  SQLiteKyselyWorkflowService,
22
22
  } from '@pikku/kysely-sqlite'
23
+ import { KyselyLeaseService } from '@pikku/kysely'
23
24
  import Database from 'better-sqlite3'
24
25
 
25
26
  const db = createSQLiteKysely(new Database('app.db'))
26
27
 
27
- const workflowService = new SQLiteKyselyWorkflowService(db)
28
+ const leaseService = new KyselyLeaseService(db)
29
+ await leaseService.init()
30
+
31
+ const workflowService = new SQLiteKyselyWorkflowService(db, { leaseService })
28
32
  ```
29
33
 
34
+ The workflow service locks runs and steps on the `leaseService` you give it;
35
+ register the same instance as the app's `leaseService`.
36
+
30
37
  ## Docs
31
38
 
32
39
  https://pikku.dev/docs
@@ -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.16",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -22,14 +22,14 @@
22
22
  "prepublishOnly": "bun run build"
23
23
  },
24
24
  "dependencies": {
25
- "@pikku/kysely": "^0.13.25",
25
+ "@pikku/kysely": "^0.13.33",
26
26
  "kysely": "^0.29.5"
27
27
  },
28
28
  "peerDependencies": {
29
- "@pikku/core": "^0.12.108"
29
+ "@pikku/core": "^0.12.133"
30
30
  },
31
31
  "devDependencies": {
32
- "@pikku/core": "^0.12.108"
32
+ "@pikku/core": "^0.12.133"
33
33
  },
34
34
  "exports": {
35
35
  ".": "./dist/src/index.js"