@effect/sql-sqlite-bun 4.0.0-beta.66 → 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.
@@ -7,18 +7,24 @@ import * as Reactivity from "effect/unstable/reactivity/Reactivity";
7
7
  import * as Client from "effect/unstable/sql/SqlClient";
8
8
  import { SqlError } from "effect/unstable/sql/SqlError";
9
9
  /**
10
- * @category type ids
11
- * @since 1.0.0
10
+ * Runtime type identifier used to mark Bun `SqliteClient` values.
11
+ *
12
+ * @category type IDs
13
+ * @since 4.0.0
12
14
  */
13
15
  export declare const TypeId: TypeId;
14
16
  /**
15
- * @category type ids
16
- * @since 1.0.0
17
+ * Type-level identifier used to mark Bun `SqliteClient` values.
18
+ *
19
+ * @category type IDs
20
+ * @since 4.0.0
17
21
  */
18
22
  export type TypeId = "~@effect/sql-sqlite-bun/SqliteClient";
19
23
  /**
24
+ * Bun SQLite client service, extending `SqlClient` with database export and extension loading helpers. `updateValues` is not supported.
25
+ *
20
26
  * @category models
21
- * @since 1.0.0
27
+ * @since 4.0.0
22
28
  */
23
29
  export interface SqliteClient extends Client.SqlClient {
24
30
  readonly [TypeId]: TypeId;
@@ -29,13 +35,17 @@ export interface SqliteClient extends Client.SqlClient {
29
35
  readonly updateValues: never;
30
36
  }
31
37
  /**
38
+ * Context tag used to access the Bun `SqliteClient` service.
39
+ *
32
40
  * @category tags
33
- * @since 1.0.0
41
+ * @since 4.0.0
34
42
  */
35
43
  export declare const SqliteClient: Context.Service<SqliteClient, SqliteClient>;
36
44
  /**
45
+ * Configuration for a Bun SQLite client, including filename, open mode flags, WAL behavior, span attributes, and query/result name transforms.
46
+ *
37
47
  * @category models
38
- * @since 1.0.0
48
+ * @since 4.0.0
39
49
  */
40
50
  export interface SqliteClientConfig {
41
51
  readonly filename: string;
@@ -48,18 +58,24 @@ export interface SqliteClientConfig {
48
58
  readonly transformQueryNames?: ((str: string) => string) | undefined;
49
59
  }
50
60
  /**
51
- * @category constructor
52
- * @since 1.0.0
61
+ * Creates a scoped Bun SQLite client for a database file, enabling WAL by default and serializing access. Streaming queries are not implemented.
62
+ *
63
+ * @category constructors
64
+ * @since 4.0.0
53
65
  */
54
66
  export declare const make: (options: SqliteClientConfig) => Effect.Effect<SqliteClient, never, Scope.Scope | Reactivity.Reactivity>;
55
67
  /**
68
+ * Creates a layer from a `Config`-wrapped Bun SQLite client configuration, providing both `SqliteClient` and `SqlClient`.
69
+ *
56
70
  * @category layers
57
- * @since 1.0.0
71
+ * @since 4.0.0
58
72
  */
59
73
  export declare const layerConfig: (config: Config.Wrap<SqliteClientConfig>) => Layer.Layer<SqliteClient | Client.SqlClient, Config.ConfigError>;
60
74
  /**
75
+ * Creates a layer from a concrete Bun SQLite client configuration, providing both `SqliteClient` and `SqlClient`.
76
+ *
61
77
  * @category layers
62
- * @since 1.0.0
78
+ * @since 4.0.0
63
79
  */
64
80
  export declare const layer: (config: SqliteClientConfig) => Layer.Layer<SqliteClient | Client.SqlClient>;
65
81
  //# sourceMappingURL=SqliteClient.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteClient.d.ts","sourceRoot":"","sources":["../src/SqliteClient.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AACvC,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAA;AACzC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAGvC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAGrC,OAAO,KAAK,UAAU,MAAM,uCAAuC,CAAA;AACnE,OAAO,KAAK,MAAM,MAAM,+BAA+B,CAAA;AAEvD,OAAO,EAAuB,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAQ5E;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,MAA+C,CAAA;AAEpE;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG,sCAAsC,C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KG;AACH,eAAO,MAAM,KAAK,GAChB,QAAQ,kBAAkB,KACzB,KAAK,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,SAAS,CAML,CAAA"}
@@ -1,5 +1,22 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun SQLite client implementation for Effect SQL, backed by `bun:sqlite`.
3
+ *
4
+ * This module provides constructors and layers for using a Bun-managed SQLite database as both the
5
+ * SQLite-specific `SqliteClient` service and the generic `SqlClient` service. It is intended for
6
+ * file-backed or in-memory databases in Bun applications, local development tools, migrations,
7
+ * integration tests, and embedded persistence use cases that need Effect SQL query compilation plus
8
+ * SQLite-specific helpers such as database export and native extension loading.
9
+ *
10
+ * Each client owns one scoped `bun:sqlite` `Database` handle and serializes access through it, which
11
+ * is important because Bun executes SQLite statements synchronously. WAL mode is enabled by default,
12
+ * so set `disableWAL` when opening read-only databases or when the database file or directory cannot
13
+ * be updated with SQLite's WAL side files. A transaction holds the serialized connection permit for
14
+ * the transaction scope, so concurrent fibers using the same client wait until it completes, while
15
+ * separate database handles or processes can still contend for SQLite write locks. Safe integer
16
+ * handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
17
+ * SQLite does not support `updateValues`.
18
+ *
19
+ * @since 4.0.0
3
20
  */
4
21
  import { Database } from "bun:sqlite";
5
22
  import * as Config from "effect/Config";
@@ -21,18 +38,24 @@ const classifyError = (cause, message, operation) => classifySqliteError(cause,
21
38
  operation
22
39
  });
23
40
  /**
24
- * @category type ids
25
- * @since 1.0.0
41
+ * Runtime type identifier used to mark Bun `SqliteClient` values.
42
+ *
43
+ * @category type IDs
44
+ * @since 4.0.0
26
45
  */
27
46
  export const TypeId = "~@effect/sql-sqlite-bun/SqliteClient";
28
47
  /**
48
+ * Context tag used to access the Bun `SqliteClient` service.
49
+ *
29
50
  * @category tags
30
- * @since 1.0.0
51
+ * @since 4.0.0
31
52
  */
32
53
  export const SqliteClient = /*#__PURE__*/Context.Service("@effect/sql-sqlite-bun/Client");
33
54
  /**
34
- * @category constructor
35
- * @since 1.0.0
55
+ * Creates a scoped Bun SQLite client for a database file, enabling WAL by default and serializing access. Streaming queries are not implemented.
56
+ *
57
+ * @category constructors
58
+ * @since 4.0.0
36
59
  */
37
60
  export const make = options => Effect.gen(function* () {
38
61
  const compiler = Statement.makeCompilerSqlite(options.transformQueryNames);
@@ -125,13 +148,17 @@ export const make = options => Effect.gen(function* () {
125
148
  });
126
149
  });
127
150
  /**
151
+ * Creates a layer from a `Config`-wrapped Bun SQLite client configuration, providing both `SqliteClient` and `SqlClient`.
152
+ *
128
153
  * @category layers
129
- * @since 1.0.0
154
+ * @since 4.0.0
130
155
  */
131
156
  export const layerConfig = config => Layer.effectContext(Config.unwrap(config).pipe(Effect.flatMap(make), Effect.map(client => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client))))).pipe(Layer.provide(Reactivity.layer));
132
157
  /**
158
+ * Creates a layer from a concrete Bun SQLite client configuration, providing both `SqliteClient` and `SqlClient`.
159
+ *
133
160
  * @category layers
134
- * @since 1.0.0
161
+ * @since 4.0.0
135
162
  */
136
163
  export const layer = config => Layer.effectContext(Effect.map(make(config), client => Context.make(SqliteClient, client).pipe(Context.add(Client.SqlClient, client)))).pipe(Layer.provide(Reactivity.layer));
137
164
  //# sourceMappingURL=SqliteClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteClient.js","names":["Database","Config","Context","Effect","Fiber","identity","Layer","Scope","Semaphore","Stream","Reactivity","Client","classifySqliteError","SqlError","Statement","ATTR_DB_SYSTEM_NAME","classifyError","cause","message","operation","TypeId","SqliteClient","Service","make","options","gen","compiler","makeCompilerSqlite","transformQueryNames","transformRows","transformResultNames","defaultTransforms","array","undefined","makeConnection","db","filename","readonly","readwrite","create","addFinalizer","sync","close","disableWAL","run","sql","params","withFiber","fiber","statement","query","useSafeIntegers","get","context","SafeIntegers","safeIntegers","succeed","all","fail","reason","runValues","values","execute","map","executeRaw","executeValues","executeUnprepared","executeStream","_sql","_params","die","export","try","serialize","catch","loadExtension","path","semaphore","connection","acquirer","withPermits","transactionAcquirer","uninterruptibleMask","restore","getCurrent","scope","getUnsafe","as","tap","take","release","Object","assign","spanAttributes","entries","config","flatMap","_","layerConfig","effectContext","unwrap","pipe","client","add","SqlClient","provide","layer"],"sources":["../src/SqliteClient.ts"],"sourcesContent":[null],"mappings":"AAAA;;;AAGA,SAASA,QAAQ,QAAQ,YAAY;AACrC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,OAAO,MAAM,gBAAgB;AACzC,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,SAAS,MAAM,kBAAkB;AAC7C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,UAAU,MAAM,uCAAuC;AACnE,OAAO,KAAKC,MAAM,MAAM,+BAA+B;AAEvD,SAASC,mBAAmB,EAAEC,QAAQ,QAAQ,8BAA8B;AAC5E,OAAO,KAAKC,SAAS,MAAM,+BAA+B;AAE1D,MAAMC,mBAAmB,GAAG,gBAAgB;AAE5C,MAAMC,aAAa,GAAGA,CAACC,KAAc,EAAEC,OAAe,EAAEC,SAAiB,KACvEP,mBAAmB,CAACK,KAAK,EAAE;EAAEC,OAAO;EAAEC;AAAS,CAAE,CAAC;AAEpD;;;;AAIA,OAAO,MAAMC,MAAM,GAAW,sCAAsC;AAsBpE;;;;AAIA,OAAO,MAAMC,YAAY,gBAAGnB,OAAO,CAACoB,OAAO,CAAe,+BAA+B,CAAC;AAwB1F;;;;AAIA,OAAO,MAAMC,IAAI,GACfC,OAA2B,IAE3BrB,MAAM,CAACsB,GAAG,CAAC,aAAS;EAClB,MAAMC,QAAQ,GAAGZ,SAAS,CAACa,kBA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CAAC,CAACD,IAAI,CACrCnG,OAAO,CAACqG,GAAG,CAAC5F,MAAM,CAAC6F,SAAS,EAAEF,MAAM,CAAC,CACtC,CACF,CACF,CACF,CAACD,IAAI,CAAC/F,KAAK,CAACmG,OAAO,CAAC/F,UAAU,CAACgG,KAAK,CAAC,CAAC;AAEzC;;;;AAIA,OAAO,MAAMA,KAAK,GAChBX,MAA0B,IAE1BzF,KAAK,CAAC6F,aAAa,CACjBhG,MAAM,CAAC4D,GAAG,CAACxC,IAAI,CAACwE,MAAM,CAAC,EAAGO,MAAM,IAC9BpG,OAAO,CAACqB,IAAI,CAACF,YAAY,EAAEiF,MAAM,CAAC,CAACD,IAAI,CACrCnG,OAAO,CAACqG,GAAG,CAAC5F,MAAM,CAAC6F,SAAS,EAAEF,MAAM,CAAC,CACtC,CAAC,CACL,CAACD,IAAI,CAAC/F,KAAK,CAACmG,OAAO,CAAC/F,UAAU,CAACgG,KAAK,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SqliteClient.js","names":["Database","Config","Context","Effect","Fiber","identity","Layer","Scope","Semaphore","Stream","Reactivity","Client","classifySqliteError","SqlError","Statement","ATTR_DB_SYSTEM_NAME","classifyError","cause","message","operation","TypeId","SqliteClient","Service","make","options","gen","compiler","makeCompilerSqlite","transformQueryNames","transformRows","transformResultNames","defaultTransforms","array","undefined","makeConnection","db","filename","readonly","readwrite","create","addFinalizer","sync","close","disableWAL","run","sql","params","withFiber","fiber","statement","query","useSafeIntegers","get","context","SafeIntegers","safeIntegers","succeed","all","fail","reason","runValues","values","execute","map","executeRaw","executeValues","executeUnprepared","executeStream","_sql","_params","die","export","try","serialize","catch","loadExtension","path","semaphore","connection","acquirer","withPermits","transactionAcquirer","uninterruptibleMask","restore","getCurrent","scope","getUnsafe","as","tap","take","release","Object","assign","spanAttributes","entries","config","flatMap","_","layerConfig","effectContext","unwrap","pipe","client","add","SqlClient","provide","layer"],"sources":["../src/SqliteClient.ts"],"sourcesContent":[null],"mappings":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EzC;;;;;;AAMA,OAAO,MAAMA,KAAK,GAChBX,MAA0B,IAE1BzF,KAAK,CAAC6F,aAAa,CACjBhG,MAAM,CAAC4D,GAAG,CAACxC,IAAI,CAACwE,MAAM,CAAC,EAAGO,MAAM,IAC9BpG,OAAO,CAACqB,IAAI,CAACF,YAAY,EAAEiF,MAAM,CAAC,CAACD,IAAI,CACrCnG,OAAO,CAACqG,GAAG,CAAC5F,MAAM,CAAC6F,SAAS,EAAEF,MAAM,CAAC,CACtC,CAAC,CACL,CAACD,IAAI,CAAC/F,KAAK,CAACmG,OAAO,CAAC/F,UAAU,CAACgG,KAAK,CAAC,CAAC","ignoreList":[]}
@@ -1,5 +1,25 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Utilities for applying Effect SQL migrations to Bun SQLite databases.
3
+ *
4
+ * This module re-exports the shared `Migrator` loaders and error types, then
5
+ * provides `run` and `layer` helpers for applying ordered migrations through
6
+ * the current Bun-backed SQLite `SqlClient`. It is typically used at
7
+ * application startup, in deployment or setup scripts that prepare a local
8
+ * SQLite file, in integration tests with temporary database files, or in layer
9
+ * graphs that must install the schema before dependent services are acquired.
10
+ *
11
+ * Migrations are recorded in `effect_sql_migrations` by default and are loaded
12
+ * using the shared `<id>_<name>` file or record-key convention. Only migrations
13
+ * with an id greater than the latest recorded id are applied, so every client
14
+ * involved in startup should point at the same SQLite filename and use a
15
+ * writable Bun SQLite configuration. The Bun client enables WAL by default and
16
+ * serializes access through a single `bun:sqlite` database handle, but separate
17
+ * handles or processes can still contend for SQLite write locks. Bun's SQLite
18
+ * driver runs statements synchronously, so large migration sets can block the
19
+ * invoking runtime thread, and this adapter does not currently write SQLite
20
+ * schema dumps for `schemaDirectory`.
21
+ *
22
+ * @since 4.0.0
3
23
  */
4
24
  import type * as Effect from "effect/Effect";
5
25
  import * as Layer from "effect/Layer";
@@ -7,17 +27,21 @@ import * as Migrator from "effect/unstable/sql/Migrator";
7
27
  import type * as Client from "effect/unstable/sql/SqlClient";
8
28
  import type { SqlError } from "effect/unstable/sql/SqlError";
9
29
  /**
10
- * @since 1.0.0
30
+ * @since 4.0.0
11
31
  */
12
32
  export * from "effect/unstable/sql/Migrator";
13
33
  /**
14
- * @category constructor
15
- * @since 1.0.0
34
+ * Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
35
+ *
36
+ * @category constructors
37
+ * @since 4.0.0
16
38
  */
17
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>;
18
40
  /**
19
- * @category constructor
20
- * @since 1.0.0
41
+ * Creates a layer that runs the configured SQL migrations during layer construction.
42
+ *
43
+ * @category constructors
44
+ * @since 4.0.0
21
45
  */
22
46
  export declare const layer: <R>(options: Migrator.MigratorOptions<R>) => Layer.Layer<never, SqlError | Migrator.MigrationError, Client.SqlClient | R>;
23
47
  //# sourceMappingURL=SqliteMigrator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteMigrator.d.ts","sourceRoot":"","sources":["../src/SqliteMigrator.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,QAAQ,MAAM,8BAA8B,CAAA;AACxD,OAAO,KAAK,KAAK,MAAM,MAAM,+BAA+B,CAAA;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAE5D;;GAEG;AACH,cAAc,8BAA8B,CAAA;AAE5C;;;GAGG;AACH,eAAO,MAAM,GAAG,EAAE,CAAC,EAAE,GAAG,KAAK,EAC3B,OAAO,EAAE,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,KAClC,MAAM,CAAC,MAAM,CAChB,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,C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,CAAC,SAAS,GAAG,CAAC,CACgB,CAAA"}
@@ -1,12 +1,14 @@
1
1
  import * as Layer from "effect/Layer";
2
2
  import * as Migrator from "effect/unstable/sql/Migrator";
3
3
  /**
4
- * @since 1.0.0
4
+ * @since 4.0.0
5
5
  */
6
6
  export * from "effect/unstable/sql/Migrator";
7
7
  /**
8
- * @category constructor
9
- * @since 1.0.0
8
+ * Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
9
+ *
10
+ * @category constructors
11
+ * @since 4.0.0
10
12
  */
11
13
  export const run = /*#__PURE__*/Migrator.make({
12
14
  // dumpSchema(path, table) {
@@ -52,8 +54,10 @@ export const run = /*#__PURE__*/Migrator.make({
52
54
  // }
53
55
  });
54
56
  /**
55
- * @category constructor
56
- * @since 1.0.0
57
+ * Creates a layer that runs the configured SQL migrations during layer construction.
58
+ *
59
+ * @category constructors
60
+ * @since 4.0.0
57
61
  */
58
62
  export const layer = options => Layer.effectDiscard(run(options));
59
63
  //# sourceMappingURL=SqliteMigrator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteMigrator.js","names":["Layer","Migrator","run","make","layer","options","effectDiscard"],"sources":["../src/SqliteMigrator.ts"],"sourcesContent":[null],"mappings":"AAIA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,8BAA8B;AAIxD;;;AAGA,cAAc,8BAA8B;AAE5C;;;;AAIA,OAAO,MAAMC,GAAG,gBAMZD,QAAQ,CAACE,IAAI,CAAC;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAAA,CACD,CAAC;AAEF;;;;AAIA,OAAO,MAAMC,KAAK,GAChBC,OAAoC,IAKjCL,KAAK,CAACM,aAAa,CAACJ,GAAG,CAACG,OAAO,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SqliteMigrator.js","names":["Layer","Migrator","run","make","layer","options","effectDiscard"],"sources":["../src/SqliteMigrator.ts"],"sourcesContent":[null],"mappings":"AAwBA,OAAO,KAAKA,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,QAAQ,MAAM,8BAA8B;AAIxD;;;AAGA,cAAc,8BAA8B;AAE5C;;;;;;AAMA,OAAO,MAAMC,GAAG,gBAMZD,QAAQ,CAACE,IAAI,CAAC;EAChB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;AAAA,CACD,CAAC;AAEF;;;;;;AAMA,OAAO,MAAMC,KAAK,GAChBC,OAAoC,IAKjCL,KAAK,CAACM,aAAa,CAACJ,GAAG,CAACG,OAAO,CAAC,CAAC","ignoreList":[]}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,49 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  /**
5
- * @since 1.0.0
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
+ *
22
+ * @since 4.0.0
6
23
  */
7
24
  export * as SqliteClient from "./SqliteClient.ts";
8
25
  /**
9
- * @since 1.0.0
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
+ *
46
+ * @since 4.0.0
10
47
  */
11
48
  export * as SqliteMigrator from "./SqliteMigrator.ts";
12
49
  //# sourceMappingURL=index.d.ts.map
@@ -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
@@ -1,13 +1,50 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
  // @barrel: Auto-generated exports. Do not edit manually.
5
5
  /**
6
- * @since 1.0.0
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
+ *
23
+ * @since 4.0.0
7
24
  */
8
25
  export * as SqliteClient from "./SqliteClient.js";
9
26
  /**
10
- * @since 1.0.0
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
+ *
47
+ * @since 4.0.0
11
48
  */
12
49
  export * as SqliteMigrator from "./SqliteMigrator.js";
13
50
  //# sourceMappingURL=index.js.map
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.66",
3
+ "version": "4.0.0-beta.68",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "A SQLite toolkit for Effect",
@@ -43,12 +43,12 @@
43
43
  "provenance": true
44
44
  },
45
45
  "devDependencies": {
46
- "@types/bun": "^1.3.12",
47
- "@effect/platform-bun": "^4.0.0-beta.66",
48
- "effect": "^4.0.0-beta.66"
46
+ "@types/bun": "^1.3.13",
47
+ "@effect/platform-bun": "^4.0.0-beta.68",
48
+ "effect": "^4.0.0-beta.68"
49
49
  },
50
50
  "peerDependencies": {
51
- "effect": "^4.0.0-beta.66"
51
+ "effect": "^4.0.0-beta.68"
52
52
  },
53
53
  "scripts": {
54
54
  "codegen": "effect-utils codegen",
@@ -1,5 +1,22 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Bun SQLite client implementation for Effect SQL, backed by `bun:sqlite`.
3
+ *
4
+ * This module provides constructors and layers for using a Bun-managed SQLite database as both the
5
+ * SQLite-specific `SqliteClient` service and the generic `SqlClient` service. It is intended for
6
+ * file-backed or in-memory databases in Bun applications, local development tools, migrations,
7
+ * integration tests, and embedded persistence use cases that need Effect SQL query compilation plus
8
+ * SQLite-specific helpers such as database export and native extension loading.
9
+ *
10
+ * Each client owns one scoped `bun:sqlite` `Database` handle and serializes access through it, which
11
+ * is important because Bun executes SQLite statements synchronously. WAL mode is enabled by default,
12
+ * so set `disableWAL` when opening read-only databases or when the database file or directory cannot
13
+ * be updated with SQLite's WAL side files. A transaction holds the serialized connection permit for
14
+ * the transaction scope, so concurrent fibers using the same client wait until it completes, while
15
+ * separate database handles or processes can still contend for SQLite write locks. Safe integer
16
+ * handling follows the `SqlClient` fiber-local setting, `executeStream` is not implemented, and
17
+ * SQLite does not support `updateValues`.
18
+ *
19
+ * @since 4.0.0
3
20
  */
4
21
  import { Database } from "bun:sqlite"
5
22
  import * as Config from "effect/Config"
@@ -23,20 +40,26 @@ const classifyError = (cause: unknown, message: string, operation: string) =>
23
40
  classifySqliteError(cause, { message, operation })
24
41
 
25
42
  /**
26
- * @category type ids
27
- * @since 1.0.0
43
+ * Runtime type identifier used to mark Bun `SqliteClient` values.
44
+ *
45
+ * @category type IDs
46
+ * @since 4.0.0
28
47
  */
29
48
  export const TypeId: TypeId = "~@effect/sql-sqlite-bun/SqliteClient"
30
49
 
31
50
  /**
32
- * @category type ids
33
- * @since 1.0.0
51
+ * Type-level identifier used to mark Bun `SqliteClient` values.
52
+ *
53
+ * @category type IDs
54
+ * @since 4.0.0
34
55
  */
35
56
  export type TypeId = "~@effect/sql-sqlite-bun/SqliteClient"
36
57
 
37
58
  /**
59
+ * Bun SQLite client service, extending `SqlClient` with database export and extension loading helpers. `updateValues` is not supported.
60
+ *
38
61
  * @category models
39
- * @since 1.0.0
62
+ * @since 4.0.0
40
63
  */
41
64
  export interface SqliteClient extends Client.SqlClient {
42
65
  readonly [TypeId]: TypeId
@@ -49,14 +72,18 @@ export interface SqliteClient extends Client.SqlClient {
49
72
  }
50
73
 
51
74
  /**
75
+ * Context tag used to access the Bun `SqliteClient` service.
76
+ *
52
77
  * @category tags
53
- * @since 1.0.0
78
+ * @since 4.0.0
54
79
  */
55
80
  export const SqliteClient = Context.Service<SqliteClient>("@effect/sql-sqlite-bun/Client")
56
81
 
57
82
  /**
83
+ * Configuration for a Bun SQLite client, including filename, open mode flags, WAL behavior, span attributes, and query/result name transforms.
84
+ *
58
85
  * @category models
59
- * @since 1.0.0
86
+ * @since 4.0.0
60
87
  */
61
88
  export interface SqliteClientConfig {
62
89
  readonly filename: string
@@ -77,8 +104,10 @@ interface SqliteConnection extends Connection {
77
104
  }
78
105
 
79
106
  /**
80
- * @category constructor
81
- * @since 1.0.0
107
+ * Creates a scoped Bun SQLite client for a database file, enabling WAL by default and serializing access. Streaming queries are not implemented.
108
+ *
109
+ * @category constructors
110
+ * @since 4.0.0
82
111
  */
83
112
  export const make = (
84
113
  options: SqliteClientConfig
@@ -203,8 +232,10 @@ export const make = (
203
232
  })
204
233
 
205
234
  /**
235
+ * Creates a layer from a `Config`-wrapped Bun SQLite client configuration, providing both `SqliteClient` and `SqlClient`.
236
+ *
206
237
  * @category layers
207
- * @since 1.0.0
238
+ * @since 4.0.0
208
239
  */
209
240
  export const layerConfig = (
210
241
  config: Config.Wrap<SqliteClientConfig>
@@ -221,8 +252,10 @@ export const layerConfig = (
221
252
  ).pipe(Layer.provide(Reactivity.layer))
222
253
 
223
254
  /**
255
+ * Creates a layer from a concrete Bun SQLite client configuration, providing both `SqliteClient` and `SqlClient`.
256
+ *
224
257
  * @category layers
225
- * @since 1.0.0
258
+ * @since 4.0.0
226
259
  */
227
260
  export const layer = (
228
261
  config: SqliteClientConfig
@@ -1,5 +1,25 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * Utilities for applying Effect SQL migrations to Bun SQLite databases.
3
+ *
4
+ * This module re-exports the shared `Migrator` loaders and error types, then
5
+ * provides `run` and `layer` helpers for applying ordered migrations through
6
+ * the current Bun-backed SQLite `SqlClient`. It is typically used at
7
+ * application startup, in deployment or setup scripts that prepare a local
8
+ * SQLite file, in integration tests with temporary database files, or in layer
9
+ * graphs that must install the schema before dependent services are acquired.
10
+ *
11
+ * Migrations are recorded in `effect_sql_migrations` by default and are loaded
12
+ * using the shared `<id>_<name>` file or record-key convention. Only migrations
13
+ * with an id greater than the latest recorded id are applied, so every client
14
+ * involved in startup should point at the same SQLite filename and use a
15
+ * writable Bun SQLite configuration. The Bun client enables WAL by default and
16
+ * serializes access through a single `bun:sqlite` database handle, but separate
17
+ * handles or processes can still contend for SQLite write locks. Bun's SQLite
18
+ * driver runs statements synchronously, so large migration sets can block the
19
+ * invoking runtime thread, and this adapter does not currently write SQLite
20
+ * schema dumps for `schemaDirectory`.
21
+ *
22
+ * @since 4.0.0
3
23
  */
4
24
  import type * as Effect from "effect/Effect"
5
25
  import * as Layer from "effect/Layer"
@@ -8,13 +28,15 @@ import type * as Client from "effect/unstable/sql/SqlClient"
8
28
  import type { SqlError } from "effect/unstable/sql/SqlError"
9
29
 
10
30
  /**
11
- * @since 1.0.0
31
+ * @since 4.0.0
12
32
  */
13
33
  export * from "effect/unstable/sql/Migrator"
14
34
 
15
35
  /**
16
- * @category constructor
17
- * @since 1.0.0
36
+ * Runs SQL migrations using the configured `SqlClient`, returning the migrations that were applied.
37
+ *
38
+ * @category constructors
39
+ * @since 4.0.0
18
40
  */
19
41
  export const run: <R2 = never>(
20
42
  options: Migrator.MigratorOptions<R2>
@@ -67,8 +89,10 @@ export const run: <R2 = never>(
67
89
  })
68
90
 
69
91
  /**
70
- * @category constructor
71
- * @since 1.0.0
92
+ * Creates a layer that runs the configured SQL migrations during layer construction.
93
+ *
94
+ * @category constructors
95
+ * @since 4.0.0
72
96
  */
73
97
  export const layer = <R>(
74
98
  options: Migrator.MigratorOptions<R>
package/src/index.ts CHANGED
@@ -1,15 +1,52 @@
1
1
  /**
2
- * @since 1.0.0
2
+ * @since 4.0.0
3
3
  */
4
4
 
5
5
  // @barrel: Auto-generated exports. Do not edit manually.
6
6
 
7
7
  /**
8
- * @since 1.0.0
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
+ *
25
+ * @since 4.0.0
9
26
  */
10
27
  export * as SqliteClient from "./SqliteClient.ts"
11
28
 
12
29
  /**
13
- * @since 1.0.0
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
+ *
50
+ * @since 4.0.0
14
51
  */
15
52
  export * as SqliteMigrator from "./SqliteMigrator.ts"