@effect/sql-sqlite-node 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 +29 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/SqliteClient.ts +3 -3
- package/src/SqliteMigrator.ts +2 -2
- package/src/index.ts +29 -0
package/dist/SqliteClient.d.ts
CHANGED
|
@@ -10,14 +10,14 @@ import { SqlError } from "effect/unstable/sql/SqlError";
|
|
|
10
10
|
/**
|
|
11
11
|
* Runtime type identifier used to mark Node `SqliteClient` values.
|
|
12
12
|
*
|
|
13
|
-
* @category type
|
|
13
|
+
* @category type IDs
|
|
14
14
|
* @since 4.0.0
|
|
15
15
|
*/
|
|
16
16
|
export declare const TypeId: TypeId;
|
|
17
17
|
/**
|
|
18
18
|
* Type-level identifier used to mark Node `SqliteClient` values.
|
|
19
19
|
*
|
|
20
|
-
* @category type
|
|
20
|
+
* @category type IDs
|
|
21
21
|
* @since 4.0.0
|
|
22
22
|
*/
|
|
23
23
|
export type TypeId = "~@effect/sql-sqlite-node/SqliteClient";
|
|
@@ -72,7 +72,7 @@ export interface SqliteClientConfig {
|
|
|
72
72
|
/**
|
|
73
73
|
* Creates a scoped node SQLite client from the supplied configuration, using a single serialized connection with WAL enabled by default and exposing SQLite-specific `export`, `backup`, and `loadExtension` operations.
|
|
74
74
|
*
|
|
75
|
-
* @category
|
|
75
|
+
* @category constructors
|
|
76
76
|
* @since 4.0.0
|
|
77
77
|
*/
|
|
78
78
|
export declare const make: (options: SqliteClientConfig) => Effect.Effect<SqliteClient, never, Scope.Scope | Reactivity.Reactivity>;
|
package/dist/SqliteClient.js
CHANGED
|
@@ -39,7 +39,7 @@ const classifyError = (cause, message, operation) => classifySqliteError(cause,
|
|
|
39
39
|
/**
|
|
40
40
|
* Runtime type identifier used to mark Node `SqliteClient` values.
|
|
41
41
|
*
|
|
42
|
-
* @category type
|
|
42
|
+
* @category type IDs
|
|
43
43
|
* @since 4.0.0
|
|
44
44
|
*/
|
|
45
45
|
export const TypeId = "~@effect/sql-sqlite-node/SqliteClient";
|
|
@@ -53,7 +53,7 @@ export const SqliteClient = /*#__PURE__*/Context.Service("@effect/sql-sqlite-nod
|
|
|
53
53
|
/**
|
|
54
54
|
* Creates a scoped node SQLite client from the supplied configuration, using a single serialized connection with WAL enabled by default and exposing SQLite-specific `export`, `backup`, and `loadExtension` operations.
|
|
55
55
|
*
|
|
56
|
-
* @category
|
|
56
|
+
* @category constructors
|
|
57
57
|
* @since 4.0.0
|
|
58
58
|
*/
|
|
59
59
|
export const make = options => Effect.gen(function* () {
|
package/dist/SqliteMigrator.d.ts
CHANGED
|
@@ -28,14 +28,14 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
28
28
|
/**
|
|
29
29
|
* Runs SQL migrations for a SQLite database using the shared `Migrator` implementation and the current `SqlClient`.
|
|
30
30
|
*
|
|
31
|
-
* @category
|
|
31
|
+
* @category constructors
|
|
32
32
|
* @since 4.0.0
|
|
33
33
|
*/
|
|
34
34
|
export declare const run: <R2 = never>(options: Migrator.MigratorOptions<R2>) => Effect.Effect<ReadonlyArray<readonly [id: number, name: string]>, Migrator.MigrationError | SqlError, Client.SqlClient | R2>;
|
|
35
35
|
/**
|
|
36
36
|
* Creates a layer that runs the configured SQLite migrations during layer construction and provides no services.
|
|
37
37
|
*
|
|
38
|
-
* @category
|
|
38
|
+
* @category constructors
|
|
39
39
|
* @since 4.0.0
|
|
40
40
|
*/
|
|
41
41
|
export declare const layer: <R>(options: Migrator.MigratorOptions<R>) => Layer.Layer<never, Migrator.MigrationError | SqlError, Client.SqlClient | R>;
|
package/dist/SqliteMigrator.js
CHANGED
|
@@ -7,7 +7,7 @@ export * from "effect/unstable/sql/Migrator";
|
|
|
7
7
|
/**
|
|
8
8
|
* Runs SQL migrations for a SQLite database using the shared `Migrator` implementation and the current `SqlClient`.
|
|
9
9
|
*
|
|
10
|
-
* @category
|
|
10
|
+
* @category constructors
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
13
|
export const run = /*#__PURE__*/Migrator.make({
|
|
@@ -56,7 +56,7 @@ export const run = /*#__PURE__*/Migrator.make({
|
|
|
56
56
|
/**
|
|
57
57
|
* Creates a layer that runs the configured SQLite migrations during layer construction and provides no services.
|
|
58
58
|
*
|
|
59
|
-
* @category
|
|
59
|
+
* @category constructors
|
|
60
60
|
* @since 4.0.0
|
|
61
61
|
*/
|
|
62
62
|
export const layer = options => Layer.effectDiscard(run(options));
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,39 @@
|
|
|
2
2
|
* @since 4.0.0
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
+
* Node.js SQLite client implementation for Effect SQL, backed by `better-sqlite3`.
|
|
6
|
+
*
|
|
7
|
+
* This module exposes constructors and layers for providing both the SQLite-specific `SqliteClient`
|
|
8
|
+
* service and the generic `SqlClient` service. It is intended for file-backed or in-memory SQLite
|
|
9
|
+
* databases in Node applications, local development tools, tests, migrations, and embedded
|
|
10
|
+
* persistence use cases that need Effect SQL query compilation plus SQLite-specific operations such
|
|
11
|
+
* as exporting a database, creating backups, or loading native SQLite extensions.
|
|
12
|
+
*
|
|
13
|
+
* Each client owns one scoped `better-sqlite3` connection and serializes access through it. WAL mode
|
|
14
|
+
* is enabled by default, so set `disableWAL` when opening read-only databases or when the database
|
|
15
|
+
* location cannot change journal mode. Prepared statements are cached by SQL text, safe integer
|
|
16
|
+
* handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
|
|
17
|
+
* SQLite does not support `updateValues`.
|
|
18
|
+
*
|
|
5
19
|
* @since 4.0.0
|
|
6
20
|
*/
|
|
7
21
|
export * as SqliteClient from "./SqliteClient.ts";
|
|
8
22
|
/**
|
|
23
|
+
* Utilities for applying Effect SQL migrations to Node.js SQLite databases.
|
|
24
|
+
*
|
|
25
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
26
|
+
* provides `run` and `layer` helpers for applying ordered migrations through the
|
|
27
|
+
* current SQLite `SqlClient`. It is typically used at application startup, in
|
|
28
|
+
* tests that create temporary database files, or in layer graphs that must
|
|
29
|
+
* ensure a file-backed SQLite schema exists before dependent services start.
|
|
30
|
+
*
|
|
31
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
32
|
+
* using the shared `<id>_<name>` file or record-key convention. Only migrations
|
|
33
|
+
* with an id greater than the latest recorded id are applied, so every client
|
|
34
|
+
* involved in startup should point at the same SQLite filename. Concurrent
|
|
35
|
+
* writers can surface SQLite lock timeout errors, and this adapter does not
|
|
36
|
+
* currently write SQLite schema dumps for `schemaDirectory`.
|
|
37
|
+
*
|
|
9
38
|
* @since 4.0.0
|
|
10
39
|
*/
|
|
11
40
|
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;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,10 +3,39 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
5
5
|
/**
|
|
6
|
+
* Node.js SQLite client implementation for Effect SQL, backed by `better-sqlite3`.
|
|
7
|
+
*
|
|
8
|
+
* This module exposes constructors and layers for providing both the SQLite-specific `SqliteClient`
|
|
9
|
+
* service and the generic `SqlClient` service. It is intended for file-backed or in-memory SQLite
|
|
10
|
+
* databases in Node applications, local development tools, tests, migrations, and embedded
|
|
11
|
+
* persistence use cases that need Effect SQL query compilation plus SQLite-specific operations such
|
|
12
|
+
* as exporting a database, creating backups, or loading native SQLite extensions.
|
|
13
|
+
*
|
|
14
|
+
* Each client owns one scoped `better-sqlite3` connection and serializes access through it. WAL mode
|
|
15
|
+
* is enabled by default, so set `disableWAL` when opening read-only databases or when the database
|
|
16
|
+
* location cannot change journal mode. Prepared statements are cached by SQL text, safe integer
|
|
17
|
+
* handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
|
|
18
|
+
* SQLite does not support `updateValues`.
|
|
19
|
+
*
|
|
6
20
|
* @since 4.0.0
|
|
7
21
|
*/
|
|
8
22
|
export * as SqliteClient from "./SqliteClient.js";
|
|
9
23
|
/**
|
|
24
|
+
* Utilities for applying Effect SQL migrations to Node.js SQLite databases.
|
|
25
|
+
*
|
|
26
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
27
|
+
* provides `run` and `layer` helpers for applying ordered migrations through the
|
|
28
|
+
* current SQLite `SqlClient`. It is typically used at application startup, in
|
|
29
|
+
* tests that create temporary database files, or in layer graphs that must
|
|
30
|
+
* ensure a file-backed SQLite schema exists before dependent services start.
|
|
31
|
+
*
|
|
32
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
33
|
+
* using the shared `<id>_<name>` file or record-key convention. Only migrations
|
|
34
|
+
* with an id greater than the latest recorded id are applied, so every client
|
|
35
|
+
* involved in startup should point at the same SQLite filename. Concurrent
|
|
36
|
+
* writers can surface SQLite lock timeout errors, and this adapter does not
|
|
37
|
+
* currently write SQLite schema dumps for `schemaDirectory`.
|
|
38
|
+
*
|
|
10
39
|
* @since 4.0.0
|
|
11
40
|
*/
|
|
12
41
|
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;;;;;;;;;;;;;;;;;AAiBA,OAAO,KAAKA,YAAY,MAAM,mBAAmB;AAEjD;;;;;;;;;;;;;;;;;;AAkBA,OAAO,KAAKC,cAAc,MAAM,qBAAqB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/sql-sqlite-node",
|
|
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,11 +44,11 @@
|
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/better-sqlite3": "^7.6.13",
|
|
47
|
-
"effect": "^4.0.0-beta.
|
|
48
|
-
"
|
|
47
|
+
"@effect/platform-node": "^4.0.0-beta.68",
|
|
48
|
+
"effect": "^4.0.0-beta.68"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"effect": "^4.0.0-beta.
|
|
51
|
+
"effect": "^4.0.0-beta.68"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"better-sqlite3": "^12.9.0"
|
package/src/SqliteClient.ts
CHANGED
|
@@ -41,7 +41,7 @@ const classifyError = (cause: unknown, message: string, operation: string) =>
|
|
|
41
41
|
/**
|
|
42
42
|
* Runtime type identifier used to mark Node `SqliteClient` values.
|
|
43
43
|
*
|
|
44
|
-
* @category type
|
|
44
|
+
* @category type IDs
|
|
45
45
|
* @since 4.0.0
|
|
46
46
|
*/
|
|
47
47
|
export const TypeId: TypeId = "~@effect/sql-sqlite-node/SqliteClient"
|
|
@@ -49,7 +49,7 @@ export const TypeId: TypeId = "~@effect/sql-sqlite-node/SqliteClient"
|
|
|
49
49
|
/**
|
|
50
50
|
* Type-level identifier used to mark Node `SqliteClient` values.
|
|
51
51
|
*
|
|
52
|
-
* @category type
|
|
52
|
+
* @category type IDs
|
|
53
53
|
* @since 4.0.0
|
|
54
54
|
*/
|
|
55
55
|
export type TypeId = "~@effect/sql-sqlite-node/SqliteClient"
|
|
@@ -117,7 +117,7 @@ interface SqliteConnection extends Connection {
|
|
|
117
117
|
/**
|
|
118
118
|
* Creates a scoped node SQLite client from the supplied configuration, using a single serialized connection with WAL enabled by default and exposing SQLite-specific `export`, `backup`, and `loadExtension` operations.
|
|
119
119
|
*
|
|
120
|
-
* @category
|
|
120
|
+
* @category constructors
|
|
121
121
|
* @since 4.0.0
|
|
122
122
|
*/
|
|
123
123
|
export const make = (
|
package/src/SqliteMigrator.ts
CHANGED
|
@@ -30,7 +30,7 @@ export * from "effect/unstable/sql/Migrator"
|
|
|
30
30
|
/**
|
|
31
31
|
* Runs SQL migrations for a SQLite database using the shared `Migrator` implementation and the current `SqlClient`.
|
|
32
32
|
*
|
|
33
|
-
* @category
|
|
33
|
+
* @category constructors
|
|
34
34
|
* @since 4.0.0
|
|
35
35
|
*/
|
|
36
36
|
export const run: <R2 = never>(
|
|
@@ -86,7 +86,7 @@ export const run: <R2 = never>(
|
|
|
86
86
|
/**
|
|
87
87
|
* Creates a layer that runs the configured SQLite migrations during layer construction and provides no services.
|
|
88
88
|
*
|
|
89
|
-
* @category
|
|
89
|
+
* @category constructors
|
|
90
90
|
* @since 4.0.0
|
|
91
91
|
*/
|
|
92
92
|
export const layer = <R>(
|
package/src/index.ts
CHANGED
|
@@ -5,11 +5,40 @@
|
|
|
5
5
|
// @barrel: Auto-generated exports. Do not edit manually.
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* Node.js SQLite client implementation for Effect SQL, backed by `better-sqlite3`.
|
|
9
|
+
*
|
|
10
|
+
* This module exposes constructors and layers for providing both the SQLite-specific `SqliteClient`
|
|
11
|
+
* service and the generic `SqlClient` service. It is intended for file-backed or in-memory SQLite
|
|
12
|
+
* databases in Node applications, local development tools, tests, migrations, and embedded
|
|
13
|
+
* persistence use cases that need Effect SQL query compilation plus SQLite-specific operations such
|
|
14
|
+
* as exporting a database, creating backups, or loading native SQLite extensions.
|
|
15
|
+
*
|
|
16
|
+
* Each client owns one scoped `better-sqlite3` connection and serializes access through it. WAL mode
|
|
17
|
+
* is enabled by default, so set `disableWAL` when opening read-only databases or when the database
|
|
18
|
+
* location cannot change journal mode. Prepared statements are cached by SQL text, safe integer
|
|
19
|
+
* handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
|
|
20
|
+
* SQLite does not support `updateValues`.
|
|
21
|
+
*
|
|
8
22
|
* @since 4.0.0
|
|
9
23
|
*/
|
|
10
24
|
export * as SqliteClient from "./SqliteClient.ts"
|
|
11
25
|
|
|
12
26
|
/**
|
|
27
|
+
* Utilities for applying Effect SQL migrations to Node.js SQLite databases.
|
|
28
|
+
*
|
|
29
|
+
* This module re-exports the shared `Migrator` loaders and error types, then
|
|
30
|
+
* provides `run` and `layer` helpers for applying ordered migrations through the
|
|
31
|
+
* current SQLite `SqlClient`. It is typically used at application startup, in
|
|
32
|
+
* tests that create temporary database files, or in layer graphs that must
|
|
33
|
+
* ensure a file-backed SQLite schema exists before dependent services start.
|
|
34
|
+
*
|
|
35
|
+
* Migrations are recorded in `effect_sql_migrations` by default and are loaded
|
|
36
|
+
* using the shared `<id>_<name>` file or record-key convention. Only migrations
|
|
37
|
+
* with an id greater than the latest recorded id are applied, so every client
|
|
38
|
+
* involved in startup should point at the same SQLite filename. Concurrent
|
|
39
|
+
* writers can surface SQLite lock timeout errors, and this adapter does not
|
|
40
|
+
* currently write SQLite schema dumps for `schemaDirectory`.
|
|
41
|
+
*
|
|
13
42
|
* @since 4.0.0
|
|
14
43
|
*/
|
|
15
44
|
export * as SqliteMigrator from "./SqliteMigrator.ts"
|