@effect/sql-sqlite-do 4.0.0-beta.67 → 4.0.0-beta.68
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/dist/SqliteClient.d.ts +3 -3
- package/dist/SqliteClient.js +2 -2
- package/dist/SqliteMigrator.d.ts +2 -2
- package/dist/SqliteMigrator.js +2 -2
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/SqliteClient.ts +3 -3
- package/src/SqliteMigrator.ts +2 -2
- package/src/index.ts +39 -0
package/dist/SqliteClient.d.ts
CHANGED
|
@@ -30,14 +30,14 @@ import * as Client from "effect/unstable/sql/SqlClient";
|
|
|
30
30
|
/**
|
|
31
31
|
* Runtime type identifier used to mark Cloudflare Durable Object `SqliteClient` values.
|
|
32
32
|
*
|
|
33
|
-
* @category type
|
|
33
|
+
* @category type IDs
|
|
34
34
|
* @since 4.0.0
|
|
35
35
|
*/
|
|
36
36
|
export declare const TypeId: TypeId;
|
|
37
37
|
/**
|
|
38
38
|
* Type-level identifier used to mark Cloudflare Durable Object `SqliteClient` values.
|
|
39
39
|
*
|
|
40
|
-
* @category type
|
|
40
|
+
* @category type IDs
|
|
41
41
|
* @since 4.0.0
|
|
42
42
|
*/
|
|
43
43
|
export type TypeId = "~@effect/sql-sqlite-do/SqliteClient";
|
|
@@ -75,7 +75,7 @@ export interface SqliteClientConfig {
|
|
|
75
75
|
/**
|
|
76
76
|
* Creates a scoped Cloudflare Durable Object SQLite client around `SqlStorage`, serializing access and converting returned `ArrayBuffer` values to `Uint8Array`.
|
|
77
77
|
*
|
|
78
|
-
* @category
|
|
78
|
+
* @category constructors
|
|
79
79
|
* @since 4.0.0
|
|
80
80
|
*/
|
|
81
81
|
export declare const make: (options: SqliteClientConfig) => Effect.Effect<SqliteClient, never, Scope.Scope | Reactivity.Reactivity>;
|
package/dist/SqliteClient.js
CHANGED
|
@@ -19,7 +19,7 @@ const classifyError = (cause, message, operation) => classifySqliteError(cause,
|
|
|
19
19
|
/**
|
|
20
20
|
* Runtime type identifier used to mark Cloudflare Durable Object `SqliteClient` values.
|
|
21
21
|
*
|
|
22
|
-
* @category type
|
|
22
|
+
* @category type IDs
|
|
23
23
|
* @since 4.0.0
|
|
24
24
|
*/
|
|
25
25
|
export const TypeId = "~@effect/sql-sqlite-do/SqliteClient";
|
|
@@ -33,7 +33,7 @@ export const SqliteClient = /*#__PURE__*/Context.Service("@effect/sql-sqlite-do/
|
|
|
33
33
|
/**
|
|
34
34
|
* Creates a scoped Cloudflare Durable Object SQLite client around `SqlStorage`, serializing access and converting returned `ArrayBuffer` values to `Uint8Array`.
|
|
35
35
|
*
|
|
36
|
-
* @category
|
|
36
|
+
* @category constructors
|
|
37
37
|
* @since 4.0.0
|
|
38
38
|
*/
|
|
39
39
|
export const make = options => Effect.gen(function* () {
|
package/dist/SqliteMigrator.d.ts
CHANGED
|
@@ -34,14 +34,14 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
34
34
|
/**
|
|
35
35
|
* Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
|
|
36
36
|
*
|
|
37
|
-
* @category
|
|
37
|
+
* @category constructors
|
|
38
38
|
* @since 4.0.0
|
|
39
39
|
*/
|
|
40
40
|
export declare const run: <R2 = never>({ loader, schemaDirectory, table }: Migrator.MigratorOptions<R2>) => Effect.Effect<ReadonlyArray<readonly [id: number, name: string]>, Migrator.MigrationError | SqlError, Client.SqlClient | R2>;
|
|
41
41
|
/**
|
|
42
42
|
* Creates a layer that runs the configured SQL migrations during layer construction.
|
|
43
43
|
*
|
|
44
|
-
* @category
|
|
44
|
+
* @category constructors
|
|
45
45
|
* @since 4.0.0
|
|
46
46
|
*/
|
|
47
47
|
export declare const layer: <R>(options: Migrator.MigratorOptions<R>) => Layer.Layer<never, Migrator.MigrationError | SqlError, Client.SqlClient | R>;
|
package/dist/SqliteMigrator.js
CHANGED
|
@@ -7,14 +7,14 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
7
7
|
/**
|
|
8
8
|
* Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
|
|
9
9
|
*
|
|
10
|
-
* @category
|
|
10
|
+
* @category constructors
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
13
|
export const run = /*#__PURE__*/Migrator.make({});
|
|
14
14
|
/**
|
|
15
15
|
* Creates a layer that runs the configured SQL migrations during layer construction.
|
|
16
16
|
*
|
|
17
|
-
* @category
|
|
17
|
+
* @category constructors
|
|
18
18
|
* @since 4.0.0
|
|
19
19
|
*/
|
|
20
20
|
export const layer = options => Layer.effectDiscard(run(options));
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,49 @@
|
|
|
2
2
|
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
+
* Provides an Effect SQL client for Cloudflare Durable Object SQLite storage.
|
|
6
|
+
*
|
|
7
|
+
* This module adapts a Durable Object `SqlStorage` handle into both the
|
|
8
|
+
* Durable Object-specific `SqliteClient` service and the generic Effect
|
|
9
|
+
* `SqlClient` service. Use it from inside a Durable Object to run local
|
|
10
|
+
* per-object queries, repositories, migrations, transactional read/write
|
|
11
|
+
* workflows, and tests that exercise Cloudflare's SQLite-backed storage API.
|
|
12
|
+
*
|
|
13
|
+
* Durable Object SQLite storage is scoped to one object id, so each object
|
|
14
|
+
* instance has its own database and callers should pass the same `SqlStorage`
|
|
15
|
+
* handle that the object uses for normal reads and writes. This adapter
|
|
16
|
+
* serializes Effect SQL access through one connection; a transaction holds that
|
|
17
|
+
* permit for the lifetime of its scope, so keep transactions short, avoid
|
|
18
|
+
* suspending them across unrelated work, and use them when multi-statement
|
|
19
|
+
* writes must commit atomically. `SqlStorage.exec` returns `ArrayBuffer` values
|
|
20
|
+
* for SQLite blobs, which this client normalizes to `Uint8Array`, and SQLite
|
|
21
|
+
* does not support `updateValues`.
|
|
22
|
+
*
|
|
5
23
|
* @since 4.0.0
|
|
6
24
|
*/
|
|
7
25
|
export * as SqliteClient from "./SqliteClient.ts";
|
|
8
26
|
/**
|
|
27
|
+
* Utilities for applying Effect SQL migrations to Cloudflare Durable Object SQLite storage.
|
|
28
|
+
*
|
|
29
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
30
|
+
* provides `run` and `layer` helpers that execute ordered migrations through the
|
|
31
|
+
* current Durable Object `SqlStorage`-backed `SqlClient`. Use it when a Durable
|
|
32
|
+
* Object needs to create or upgrade its local schema during construction, before
|
|
33
|
+
* repositories or request handlers use the object storage, or in tests that
|
|
34
|
+
* exercise Durable Object persistence.
|
|
35
|
+
*
|
|
36
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
37
|
+
* using the shared `<id>_<name>` file or record-key convention. The underlying
|
|
38
|
+
* storage is scoped to a Durable Object id, so running migrations for one object
|
|
39
|
+
* does not update any other object instance; run the migrator against the same
|
|
40
|
+
* `SqlStorage` handle that the object uses for normal queries. These SQL
|
|
41
|
+
* migrations are separate from Cloudflare's Durable Object class migrations, and
|
|
42
|
+
* the Durable Object must already be configured with SQLite storage before this
|
|
43
|
+
* module can apply schema changes. Repeated startup runs are expected and are
|
|
44
|
+
* guarded by the migrations table, but request handling should wait until the
|
|
45
|
+
* migration layer has finished. This adapter does not currently write SQLite
|
|
46
|
+
* schema dumps for `schemaDirectory`.
|
|
47
|
+
*
|
|
9
48
|
* @since 4.0.0
|
|
10
49
|
*/
|
|
11
50
|
export * as SqliteMigrator from "./SqliteMigrator.ts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,49 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
5
5
|
/**
|
|
6
|
+
* Provides an Effect SQL client for Cloudflare Durable Object SQLite storage.
|
|
7
|
+
*
|
|
8
|
+
* This module adapts a Durable Object `SqlStorage` handle into both the
|
|
9
|
+
* Durable Object-specific `SqliteClient` service and the generic Effect
|
|
10
|
+
* `SqlClient` service. Use it from inside a Durable Object to run local
|
|
11
|
+
* per-object queries, repositories, migrations, transactional read/write
|
|
12
|
+
* workflows, and tests that exercise Cloudflare's SQLite-backed storage API.
|
|
13
|
+
*
|
|
14
|
+
* Durable Object SQLite storage is scoped to one object id, so each object
|
|
15
|
+
* instance has its own database and callers should pass the same `SqlStorage`
|
|
16
|
+
* handle that the object uses for normal reads and writes. This adapter
|
|
17
|
+
* serializes Effect SQL access through one connection; a transaction holds that
|
|
18
|
+
* permit for the lifetime of its scope, so keep transactions short, avoid
|
|
19
|
+
* suspending them across unrelated work, and use them when multi-statement
|
|
20
|
+
* writes must commit atomically. `SqlStorage.exec` returns `ArrayBuffer` values
|
|
21
|
+
* for SQLite blobs, which this client normalizes to `Uint8Array`, and SQLite
|
|
22
|
+
* does not support `updateValues`.
|
|
23
|
+
*
|
|
6
24
|
* @since 4.0.0
|
|
7
25
|
*/
|
|
8
26
|
export * as SqliteClient from "./SqliteClient.js";
|
|
9
27
|
/**
|
|
28
|
+
* Utilities for applying Effect SQL migrations to Cloudflare Durable Object SQLite storage.
|
|
29
|
+
*
|
|
30
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
31
|
+
* provides `run` and `layer` helpers that execute ordered migrations through the
|
|
32
|
+
* current Durable Object `SqlStorage`-backed `SqlClient`. Use it when a Durable
|
|
33
|
+
* Object needs to create or upgrade its local schema during construction, before
|
|
34
|
+
* repositories or request handlers use the object storage, or in tests that
|
|
35
|
+
* exercise Durable Object persistence.
|
|
36
|
+
*
|
|
37
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
38
|
+
* using the shared `<id>_<name>` file or record-key convention. The underlying
|
|
39
|
+
* storage is scoped to a Durable Object id, so running migrations for one object
|
|
40
|
+
* does not update any other object instance; run the migrator against the same
|
|
41
|
+
* `SqlStorage` handle that the object uses for normal queries. These SQL
|
|
42
|
+
* migrations are separate from Cloudflare's Durable Object class migrations, and
|
|
43
|
+
* the Durable Object must already be configured with SQLite storage before this
|
|
44
|
+
* module can apply schema changes. Repeated startup runs are expected and are
|
|
45
|
+
* guarded by the migrations table, but request handling should wait until the
|
|
46
|
+
* migration layer has finished. This adapter does not currently write SQLite
|
|
47
|
+
* schema dumps for `schemaDirectory`.
|
|
48
|
+
*
|
|
10
49
|
* @since 4.0.0
|
|
11
50
|
*/
|
|
12
51
|
export * as SqliteMigrator from "./SqliteMigrator.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["SqliteClient","SqliteMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA
|
|
1
|
+
{"version":3,"file":"index.js","names":["SqliteClient","SqliteMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;;AAqBA,OAAO,KAAKA,YAAY,MAAM,mBAAmB;AAEjD;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,OAAO,KAAKC,cAAc,MAAM,qBAAqB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/sql-sqlite-do",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.68",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "A SQLite toolkit for Effect",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@cloudflare/workers-types": "^4.20260511.1",
|
|
47
|
-
"effect": "^4.0.0-beta.
|
|
47
|
+
"effect": "^4.0.0-beta.68"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"effect": "^4.0.0-beta.
|
|
50
|
+
"effect": "^4.0.0-beta.68"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"codegen": "effect-utils codegen",
|
package/src/SqliteClient.ts
CHANGED
|
@@ -43,7 +43,7 @@ const classifyError = (cause: unknown, message: string, operation: string) =>
|
|
|
43
43
|
/**
|
|
44
44
|
* Runtime type identifier used to mark Cloudflare Durable Object `SqliteClient` values.
|
|
45
45
|
*
|
|
46
|
-
* @category type
|
|
46
|
+
* @category type IDs
|
|
47
47
|
* @since 4.0.0
|
|
48
48
|
*/
|
|
49
49
|
export const TypeId: TypeId = "~@effect/sql-sqlite-do/SqliteClient"
|
|
@@ -51,7 +51,7 @@ export const TypeId: TypeId = "~@effect/sql-sqlite-do/SqliteClient"
|
|
|
51
51
|
/**
|
|
52
52
|
* Type-level identifier used to mark Cloudflare Durable Object `SqliteClient` values.
|
|
53
53
|
*
|
|
54
|
-
* @category type
|
|
54
|
+
* @category type IDs
|
|
55
55
|
* @since 4.0.0
|
|
56
56
|
*/
|
|
57
57
|
export type TypeId = "~@effect/sql-sqlite-do/SqliteClient"
|
|
@@ -95,7 +95,7 @@ export interface SqliteClientConfig {
|
|
|
95
95
|
/**
|
|
96
96
|
* Creates a scoped Cloudflare Durable Object SQLite client around `SqlStorage`, serializing access and converting returned `ArrayBuffer` values to `Uint8Array`.
|
|
97
97
|
*
|
|
98
|
-
* @category
|
|
98
|
+
* @category constructors
|
|
99
99
|
* @since 4.0.0
|
|
100
100
|
*/
|
|
101
101
|
export const make = (
|
package/src/SqliteMigrator.ts
CHANGED
|
@@ -36,7 +36,7 @@ export * from "effect/unstable/sql/Migrator"
|
|
|
36
36
|
/**
|
|
37
37
|
* Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
|
|
38
38
|
*
|
|
39
|
-
* @category
|
|
39
|
+
* @category constructors
|
|
40
40
|
* @since 4.0.0
|
|
41
41
|
*/
|
|
42
42
|
export const run: <R2 = never>(
|
|
@@ -50,7 +50,7 @@ export const run: <R2 = never>(
|
|
|
50
50
|
/**
|
|
51
51
|
* Creates a layer that runs the configured SQL migrations during layer construction.
|
|
52
52
|
*
|
|
53
|
-
* @category
|
|
53
|
+
* @category constructors
|
|
54
54
|
* @since 4.0.0
|
|
55
55
|
*/
|
|
56
56
|
export const layer = <R>(
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,50 @@
|
|
|
5
5
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* Provides an Effect SQL client for Cloudflare Durable Object SQLite storage.
|
|
9
|
+
*
|
|
10
|
+
* This module adapts a Durable Object `SqlStorage` handle into both the
|
|
11
|
+
* Durable Object-specific `SqliteClient` service and the generic Effect
|
|
12
|
+
* `SqlClient` service. Use it from inside a Durable Object to run local
|
|
13
|
+
* per-object queries, repositories, migrations, transactional read/write
|
|
14
|
+
* workflows, and tests that exercise Cloudflare's SQLite-backed storage API.
|
|
15
|
+
*
|
|
16
|
+
* Durable Object SQLite storage is scoped to one object id, so each object
|
|
17
|
+
* instance has its own database and callers should pass the same `SqlStorage`
|
|
18
|
+
* handle that the object uses for normal reads and writes. This adapter
|
|
19
|
+
* serializes Effect SQL access through one connection; a transaction holds that
|
|
20
|
+
* permit for the lifetime of its scope, so keep transactions short, avoid
|
|
21
|
+
* suspending them across unrelated work, and use them when multi-statement
|
|
22
|
+
* writes must commit atomically. `SqlStorage.exec` returns `ArrayBuffer` values
|
|
23
|
+
* for SQLite blobs, which this client normalizes to `Uint8Array`, and SQLite
|
|
24
|
+
* does not support `updateValues`.
|
|
25
|
+
*
|
|
8
26
|
* @since 4.0.0
|
|
9
27
|
*/
|
|
10
28
|
export * as SqliteClient from "./SqliteClient.ts"
|
|
11
29
|
|
|
12
30
|
/**
|
|
31
|
+
* Utilities for applying Effect SQL migrations to Cloudflare Durable Object SQLite storage.
|
|
32
|
+
*
|
|
33
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
34
|
+
* provides `run` and `layer` helpers that execute ordered migrations through the
|
|
35
|
+
* current Durable Object `SqlStorage`-backed `SqlClient`. Use it when a Durable
|
|
36
|
+
* Object needs to create or upgrade its local schema during construction, before
|
|
37
|
+
* repositories or request handlers use the object storage, or in tests that
|
|
38
|
+
* exercise Durable Object persistence.
|
|
39
|
+
*
|
|
40
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
41
|
+
* using the shared `<id>_<name>` file or record-key convention. The underlying
|
|
42
|
+
* storage is scoped to a Durable Object id, so running migrations for one object
|
|
43
|
+
* does not update any other object instance; run the migrator against the same
|
|
44
|
+
* `SqlStorage` handle that the object uses for normal queries. These SQL
|
|
45
|
+
* migrations are separate from Cloudflare's Durable Object class migrations, and
|
|
46
|
+
* the Durable Object must already be configured with SQLite storage before this
|
|
47
|
+
* module can apply schema changes. Repeated startup runs are expected and are
|
|
48
|
+
* guarded by the migrations table, but request handling should wait until the
|
|
49
|
+
* migration layer has finished. This adapter does not currently write SQLite
|
|
50
|
+
* schema dumps for `schemaDirectory`.
|
|
51
|
+
*
|
|
13
52
|
* @since 4.0.0
|
|
14
53
|
*/
|
|
15
54
|
export * as SqliteMigrator from "./SqliteMigrator.ts"
|