@effect/sql-sqlite-bun 4.0.0-beta.67 → 4.0.0-beta.69

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.
@@ -9,14 +9,14 @@ import { SqlError } from "effect/unstable/sql/SqlError";
9
9
  /**
10
10
  * Runtime type identifier used to mark Bun `SqliteClient` values.
11
11
  *
12
- * @category type ids
12
+ * @category type IDs
13
13
  * @since 4.0.0
14
14
  */
15
15
  export declare const TypeId: TypeId;
16
16
  /**
17
17
  * Type-level identifier used to mark Bun `SqliteClient` values.
18
18
  *
19
- * @category type ids
19
+ * @category type IDs
20
20
  * @since 4.0.0
21
21
  */
22
22
  export type TypeId = "~@effect/sql-sqlite-bun/SqliteClient";
@@ -60,7 +60,7 @@ export interface SqliteClientConfig {
60
60
  /**
61
61
  * Creates a scoped Bun SQLite client for a database file, enabling WAL by default and serializing access. Streaming queries are not implemented.
62
62
  *
63
- * @category constructor
63
+ * @category constructors
64
64
  * @since 4.0.0
65
65
  */
66
66
  export declare const make: (options: SqliteClientConfig) => Effect.Effect<SqliteClient, never, Scope.Scope | Reactivity.Reactivity>;
@@ -40,7 +40,7 @@ const classifyError = (cause, message, operation) => classifySqliteError(cause,
40
40
  /**
41
41
  * Runtime type identifier used to mark Bun `SqliteClient` values.
42
42
  *
43
- * @category type ids
43
+ * @category type IDs
44
44
  * @since 4.0.0
45
45
  */
46
46
  export const TypeId = "~@effect/sql-sqlite-bun/SqliteClient";
@@ -54,7 +54,7 @@ export const SqliteClient = /*#__PURE__*/Context.Service("@effect/sql-sqlite-bun
54
54
  /**
55
55
  * Creates a scoped Bun SQLite client for a database file, enabling WAL by default and serializing access. Streaming queries are not implemented.
56
56
  *
57
- * @category constructor
57
+ * @category constructors
58
58
  * @since 4.0.0
59
59
  */
60
60
  export const make = options => Effect.gen(function* () {
@@ -33,14 +33,14 @@ export * from "effect/unstable/sql/Migrator";
33
33
  /**
34
34
  * Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
35
35
  *
36
- * @category constructor
36
+ * @category constructors
37
37
  * @since 4.0.0
38
38
  */
39
39
  export declare const run: <R2 = never>(options: Migrator.MigratorOptions<R2>) => Effect.Effect<ReadonlyArray<readonly [id: number, name: string]>, Migrator.MigrationError | SqlError, Client.SqlClient | R2>;
40
40
  /**
41
41
  * Creates a layer that runs the configured SQL migrations during layer construction.
42
42
  *
43
- * @category constructor
43
+ * @category constructors
44
44
  * @since 4.0.0
45
45
  */
46
46
  export declare const layer: <R>(options: Migrator.MigratorOptions<R>) => Layer.Layer<never, SqlError | Migrator.MigrationError, Client.SqlClient | R>;
@@ -7,7 +7,7 @@ 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 constructor
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 SQL migrations during layer construction.
58
58
  *
59
- * @category constructor
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,47 @@
2
2
  * @since 4.0.0
3
3
  */
4
4
  /**
5
+ * Bun SQLite client implementation for Effect SQL, backed by `bun:sqlite`.
6
+ *
7
+ * This module provides constructors and layers for using a Bun-managed SQLite database as both the
8
+ * SQLite-specific `SqliteClient` service and the generic `SqlClient` service. It is intended for
9
+ * file-backed or in-memory databases in Bun applications, local development tools, migrations,
10
+ * integration tests, and embedded persistence use cases that need Effect SQL query compilation plus
11
+ * SQLite-specific helpers such as database export and native extension loading.
12
+ *
13
+ * Each client owns one scoped `bun:sqlite` `Database` handle and serializes access through it, which
14
+ * is important because Bun executes SQLite statements synchronously. WAL mode is enabled by default,
15
+ * so set `disableWAL` when opening read-only databases or when the database file or directory cannot
16
+ * be updated with SQLite's WAL side files. A transaction holds the serialized connection permit for
17
+ * the transaction scope, so concurrent fibers using the same client wait until it completes, while
18
+ * separate database handles or processes can still contend for SQLite write locks. Safe integer
19
+ * handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
20
+ * SQLite does not support `updateValues`.
21
+ *
5
22
  * @since 4.0.0
6
23
  */
7
24
  export * as SqliteClient from "./SqliteClient.ts";
8
25
  /**
26
+ * Utilities for applying Effect SQL migrations to Bun SQLite databases.
27
+ *
28
+ * This module re-exports the shared `Migrator` loaders and error types, then
29
+ * provides `run` and `layer` helpers for applying ordered migrations through
30
+ * the current Bun-backed SQLite `SqlClient`. It is typically used at
31
+ * application startup, in deployment or setup scripts that prepare a local
32
+ * SQLite file, in integration tests with temporary database files, or in layer
33
+ * graphs that must install the schema before dependent services are acquired.
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 and use a
39
+ * writable Bun SQLite configuration. The Bun client enables WAL by default and
40
+ * serializes access through a single `bun:sqlite` database handle, but separate
41
+ * handles or processes can still contend for SQLite write locks. Bun's SQLite
42
+ * driver runs statements synchronously, so large migration sets can block the
43
+ * invoking runtime thread, and this adapter does not currently write SQLite
44
+ * schema dumps for `schemaDirectory`.
45
+ *
9
46
  * @since 4.0.0
10
47
  */
11
48
  export * as SqliteMigrator from "./SqliteMigrator.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,cAAc,MAAM,qBAAqB,CAAA"}
package/dist/index.js CHANGED
@@ -3,10 +3,47 @@
3
3
  */
4
4
  // @barrel: Auto-generated exports. Do not edit manually.
5
5
  /**
6
+ * Bun SQLite client implementation for Effect SQL, backed by `bun:sqlite`.
7
+ *
8
+ * This module provides constructors and layers for using a Bun-managed SQLite database as both the
9
+ * SQLite-specific `SqliteClient` service and the generic `SqlClient` service. It is intended for
10
+ * file-backed or in-memory databases in Bun applications, local development tools, migrations,
11
+ * integration tests, and embedded persistence use cases that need Effect SQL query compilation plus
12
+ * SQLite-specific helpers such as database export and native extension loading.
13
+ *
14
+ * Each client owns one scoped `bun:sqlite` `Database` handle and serializes access through it, which
15
+ * is important because Bun executes SQLite statements synchronously. WAL mode is enabled by default,
16
+ * so set `disableWAL` when opening read-only databases or when the database file or directory cannot
17
+ * be updated with SQLite's WAL side files. A transaction holds the serialized connection permit for
18
+ * the transaction scope, so concurrent fibers using the same client wait until it completes, while
19
+ * separate database handles or processes can still contend for SQLite write locks. Safe integer
20
+ * handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
21
+ * SQLite does not support `updateValues`.
22
+ *
6
23
  * @since 4.0.0
7
24
  */
8
25
  export * as SqliteClient from "./SqliteClient.js";
9
26
  /**
27
+ * Utilities for applying Effect SQL migrations to Bun 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
31
+ * the current Bun-backed SQLite `SqlClient`. It is typically used at
32
+ * application startup, in deployment or setup scripts that prepare a local
33
+ * SQLite file, in integration tests with temporary database files, or in layer
34
+ * graphs that must install the schema before dependent services are acquired.
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. Only migrations
38
+ * with an id greater than the latest recorded id are applied, so every client
39
+ * involved in startup should point at the same SQLite filename and use a
40
+ * writable Bun SQLite configuration. The Bun client enables WAL by default and
41
+ * serializes access through a single `bun:sqlite` database handle, but separate
42
+ * handles or processes can still contend for SQLite write locks. Bun's SQLite
43
+ * driver runs statements synchronously, so large migration sets can block the
44
+ * invoking runtime thread, and this adapter does not currently write SQLite
45
+ * schema dumps for `schemaDirectory`.
46
+ *
10
47
  * @since 4.0.0
11
48
  */
12
49
  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;;;AAGA,OAAO,KAAKA,YAAY,MAAM,mBAAmB;AAEjD;;;AAGA,OAAO,KAAKC,cAAc,MAAM,qBAAqB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["SqliteClient","SqliteMigrator"],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAIA;AAEA;;;;;;;;;;;;;;;;;;;;AAoBA,OAAO,KAAKA,YAAY,MAAM,mBAAmB;AAEjD;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAO,KAAKC,cAAc,MAAM,qBAAqB","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/sql-sqlite-bun",
3
- "version": "4.0.0-beta.67",
3
+ "version": "4.0.0-beta.69",
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/bun": "^1.3.13",
47
- "@effect/platform-bun": "^4.0.0-beta.67",
48
- "effect": "^4.0.0-beta.67"
47
+ "@effect/platform-bun": "^4.0.0-beta.69",
48
+ "effect": "^4.0.0-beta.69"
49
49
  },
50
50
  "peerDependencies": {
51
- "effect": "^4.0.0-beta.67"
51
+ "effect": "^4.0.0-beta.69"
52
52
  },
53
53
  "scripts": {
54
54
  "codegen": "effect-utils codegen",
@@ -42,7 +42,7 @@ const classifyError = (cause: unknown, message: string, operation: string) =>
42
42
  /**
43
43
  * Runtime type identifier used to mark Bun `SqliteClient` values.
44
44
  *
45
- * @category type ids
45
+ * @category type IDs
46
46
  * @since 4.0.0
47
47
  */
48
48
  export const TypeId: TypeId = "~@effect/sql-sqlite-bun/SqliteClient"
@@ -50,7 +50,7 @@ export const TypeId: TypeId = "~@effect/sql-sqlite-bun/SqliteClient"
50
50
  /**
51
51
  * Type-level identifier used to mark Bun `SqliteClient` values.
52
52
  *
53
- * @category type ids
53
+ * @category type IDs
54
54
  * @since 4.0.0
55
55
  */
56
56
  export type TypeId = "~@effect/sql-sqlite-bun/SqliteClient"
@@ -106,7 +106,7 @@ interface SqliteConnection extends Connection {
106
106
  /**
107
107
  * Creates a scoped Bun SQLite client for a database file, enabling WAL by default and serializing access. Streaming queries are not implemented.
108
108
  *
109
- * @category constructor
109
+ * @category constructors
110
110
  * @since 4.0.0
111
111
  */
112
112
  export const make = (
@@ -35,7 +35,7 @@ export * from "effect/unstable/sql/Migrator"
35
35
  /**
36
36
  * Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
37
37
  *
38
- * @category constructor
38
+ * @category constructors
39
39
  * @since 4.0.0
40
40
  */
41
41
  export const run: <R2 = never>(
@@ -91,7 +91,7 @@ export const run: <R2 = never>(
91
91
  /**
92
92
  * Creates a layer that runs the configured SQL migrations during layer construction.
93
93
  *
94
- * @category constructor
94
+ * @category constructors
95
95
  * @since 4.0.0
96
96
  */
97
97
  export const layer = <R>(
package/src/index.ts CHANGED
@@ -5,11 +5,48 @@
5
5
  // @barrel: Auto-generated exports. Do not edit manually.
6
6
 
7
7
  /**
8
+ * Bun SQLite client implementation for Effect SQL, backed by `bun:sqlite`.
9
+ *
10
+ * This module provides constructors and layers for using a Bun-managed SQLite database as both the
11
+ * SQLite-specific `SqliteClient` service and the generic `SqlClient` service. It is intended for
12
+ * file-backed or in-memory databases in Bun applications, local development tools, migrations,
13
+ * integration tests, and embedded persistence use cases that need Effect SQL query compilation plus
14
+ * SQLite-specific helpers such as database export and native extension loading.
15
+ *
16
+ * Each client owns one scoped `bun:sqlite` `Database` handle and serializes access through it, which
17
+ * is important because Bun executes SQLite statements synchronously. WAL mode is enabled by default,
18
+ * so set `disableWAL` when opening read-only databases or when the database file or directory cannot
19
+ * be updated with SQLite's WAL side files. A transaction holds the serialized connection permit for
20
+ * the transaction scope, so concurrent fibers using the same client wait until it completes, while
21
+ * separate database handles or processes can still contend for SQLite write locks. Safe integer
22
+ * handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
23
+ * SQLite does not support `updateValues`.
24
+ *
8
25
  * @since 4.0.0
9
26
  */
10
27
  export * as SqliteClient from "./SqliteClient.ts"
11
28
 
12
29
  /**
30
+ * Utilities for applying Effect SQL migrations to Bun SQLite databases.
31
+ *
32
+ * This module re-exports the shared `Migrator` loaders and error types, then
33
+ * provides `run` and `layer` helpers for applying ordered migrations through
34
+ * the current Bun-backed SQLite `SqlClient`. It is typically used at
35
+ * application startup, in deployment or setup scripts that prepare a local
36
+ * SQLite file, in integration tests with temporary database files, or in layer
37
+ * graphs that must install the schema before dependent services are acquired.
38
+ *
39
+ * Migrations are recorded in `effect_sql_migrations` by default and are loaded
40
+ * using the shared `<id>_<name>` file or record-key convention. Only migrations
41
+ * with an id greater than the latest recorded id are applied, so every client
42
+ * involved in startup should point at the same SQLite filename and use a
43
+ * writable Bun SQLite configuration. The Bun client enables WAL by default and
44
+ * serializes access through a single `bun:sqlite` database handle, but separate
45
+ * handles or processes can still contend for SQLite write locks. Bun's SQLite
46
+ * driver runs statements synchronously, so large migration sets can block the
47
+ * invoking runtime thread, and this adapter does not currently write SQLite
48
+ * schema dumps for `schemaDirectory`.
49
+ *
13
50
  * @since 4.0.0
14
51
  */
15
52
  export * as SqliteMigrator from "./SqliteMigrator.ts"