@effect/sql-sqlite-react-native 4.0.0-rc.117 → 4.0.0-rc.118

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.
Files changed (39) hide show
  1. package/AGENTS.md +4 -4
  2. package/CLAUDE.md +4 -4
  3. package/ai-docs/package.json +1 -1
  4. package/ai-docs/src/01_effect/03_services/20_layer-composition.ts +1 -1
  5. package/ai-docs/src/01_effect/06_running/20_layer-launch.ts +1 -1
  6. package/ai-docs/src/03_stream/30_encoding.ts +1 -1
  7. package/ai-docs/src/08_observability/20_otlp-tracing.ts +2 -2
  8. package/ai-docs/src/08_observability/index.md +1 -1
  9. package/ai-docs/src/40_sql/10_basics.ts +2 -2
  10. package/ai-docs/src/40_sql/index.md +1 -1
  11. package/ai-docs/src/50_http-client/10_basics.ts +1 -1
  12. package/ai-docs/src/51_http-server/10_basics.ts +2 -2
  13. package/ai-docs/src/51_http-server/20_testing.ts +2 -2
  14. package/ai-docs/src/51_http-server/fixtures/api/Api.ts +1 -1
  15. package/ai-docs/src/51_http-server/fixtures/api/Authorization.ts +1 -1
  16. package/ai-docs/src/51_http-server/fixtures/api/System.ts +1 -1
  17. package/ai-docs/src/51_http-server/fixtures/api/Users.ts +1 -1
  18. package/ai-docs/src/51_http-server/fixtures/domain/User.ts +1 -1
  19. package/ai-docs/src/51_http-server/fixtures/server/Users/http.ts +1 -1
  20. package/ai-docs/src/51_http-server/fixtures/server/Users.ts +1 -1
  21. package/ai-docs/src/60_child-process/10_working-with-child-processes.ts +1 -1
  22. package/ai-docs/src/60_child-process/index.md +1 -1
  23. package/ai-docs/src/70_cli/10_basics.ts +1 -1
  24. package/ai-docs/src/70_cli/index.md +1 -1
  25. package/ai-docs/src/71_ai/10_language-model.ts +2 -2
  26. package/ai-docs/src/71_ai/20_tools.ts +2 -2
  27. package/ai-docs/src/71_ai/30_chat.ts +2 -2
  28. package/ai-docs/src/80_cluster/10_entities.ts +3 -3
  29. package/dist/SqliteClient.d.ts +3 -3
  30. package/dist/SqliteClient.d.ts.map +1 -1
  31. package/dist/SqliteClient.js +12 -13
  32. package/dist/SqliteClient.js.map +1 -1
  33. package/dist/SqliteMigrator.d.ts +4 -4
  34. package/dist/SqliteMigrator.d.ts.map +1 -1
  35. package/dist/SqliteMigrator.js +2 -2
  36. package/dist/SqliteMigrator.js.map +1 -1
  37. package/package.json +4 -4
  38. package/src/SqliteClient.ts +10 -21
  39. package/src/SqliteMigrator.ts +4 -4
package/AGENTS.md CHANGED
@@ -302,7 +302,7 @@ Use it when your Effect programs need testable current time, safe parsing, stabl
302
302
 
303
303
  Effect has built-in support for structured logging, distributed tracing, and
304
304
  metrics. For exporting telemetry, use the lightweight Otlp modules from
305
- `effect/unstable/observability` in new projects, or use
305
+ `effect/observability` in new projects, or use
306
306
  `@effect/opentelemetry` NodeSdk when integrating with an existing OpenTelemetry
307
307
  setup.
308
308
 
@@ -344,7 +344,7 @@ if (Predicate.isObject(thing)) {
344
344
 
345
345
  ## Working with SQL databases
346
346
 
347
- Use the `effect/unstable/sql` modules together with a driver package such as
347
+ Use the `effect/sql` modules together with a driver package such as
348
348
  `@effect/sql-sqlite-node` to access SQL databases. Define domain models with
349
349
  `Model.Class` to derive schemas for the database and JSON boundaries, run
350
350
  migrations, and write type-safe queries.
@@ -372,13 +372,13 @@ Build http clients with the `HttpClient` module.
372
372
 
373
373
  ## Working with child processes
374
374
 
375
- Use the `effect/unstable/process` modules to define child processes and run them with `ChildProcessSpawner`.
375
+ Use the `effect/process` modules to define child processes and run them with `ChildProcessSpawner`.
376
376
 
377
377
  - **[Working with child processes](./ai-docs/src/60_child-process/10_working-with-child-processes.ts)**: This example shows how to collect process output, compose pipelines, and stream long-running command output.
378
378
 
379
379
  ## Building CLI applications
380
380
 
381
- Use the "effect/unstable/cli" modules to build CLI applications. These modules
381
+ Use the "effect/cli" modules to build CLI applications. These modules
382
382
  provide utilities for parsing command-line arguments, handling user input, and
383
383
  managing the flow of a CLI application.
384
384
 
package/CLAUDE.md CHANGED
@@ -302,7 +302,7 @@ Use it when your Effect programs need testable current time, safe parsing, stabl
302
302
 
303
303
  Effect has built-in support for structured logging, distributed tracing, and
304
304
  metrics. For exporting telemetry, use the lightweight Otlp modules from
305
- `effect/unstable/observability` in new projects, or use
305
+ `effect/observability` in new projects, or use
306
306
  `@effect/opentelemetry` NodeSdk when integrating with an existing OpenTelemetry
307
307
  setup.
308
308
 
@@ -344,7 +344,7 @@ if (Predicate.isObject(thing)) {
344
344
 
345
345
  ## Working with SQL databases
346
346
 
347
- Use the `effect/unstable/sql` modules together with a driver package such as
347
+ Use the `effect/sql` modules together with a driver package such as
348
348
  `@effect/sql-sqlite-node` to access SQL databases. Define domain models with
349
349
  `Model.Class` to derive schemas for the database and JSON boundaries, run
350
350
  migrations, and write type-safe queries.
@@ -372,13 +372,13 @@ Build http clients with the `HttpClient` module.
372
372
 
373
373
  ## Working with child processes
374
374
 
375
- Use the `effect/unstable/process` modules to define child processes and run them with `ChildProcessSpawner`.
375
+ Use the `effect/process` modules to define child processes and run them with `ChildProcessSpawner`.
376
376
 
377
377
  - **[Working with child processes](./ai-docs/src/60_child-process/10_working-with-child-processes.ts)**: This example shows how to collect process output, compose pipelines, and stream long-running command output.
378
378
 
379
379
  ## Building CLI applications
380
380
 
381
- Use the "effect/unstable/cli" modules to build CLI applications. These modules
381
+ Use the "effect/cli" modules to build CLI applications. These modules
382
382
  provide utilities for parsing command-line arguments, handling user input, and
383
383
  managing the flow of a CLI application.
384
384
 
@@ -27,7 +27,7 @@
27
27
  "@effect/sql-sqlite-wasm": "workspace:*",
28
28
  "@effect/vitest": "workspace:*",
29
29
  "effect": "workspace:*",
30
- "hono": "^4.13.8",
30
+ "hono": "^4.13.9",
31
31
  "nodemailer": "^10.0.10"
32
32
  },
33
33
  "devDependencies": {
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { PgClient } from "@effect/sql-pg"
9
9
  import { Array, Config, Context, Effect, Layer, type Option, Schema } from "effect"
10
- import { SqlClient, SqlError } from "effect/unstable/sql"
10
+ import { SqlClient, SqlError } from "effect/sql"
11
11
 
12
12
  // Define a layer for the SqlClient service
13
13
  export const SqlClientLayer: Layer.Layer<
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { NodeHttpServer, NodeRuntime } from "@effect/platform-node"
7
7
  import { Effect, Layer } from "effect"
8
- import { HttpRouter, HttpServerResponse } from "effect/unstable/http"
8
+ import { HttpRouter, HttpServerResponse } from "effect/http"
9
9
  import { createServer } from "node:http"
10
10
 
11
11
  // Build a tiny HTTP app with a health-check endpoint.
@@ -5,7 +5,7 @@
5
5
  * decode and encode streams of structured data.
6
6
  */
7
7
  import { DateTime, Schema, Stream } from "effect"
8
- import { Ndjson, SchemaBinary } from "effect/unstable/encoding"
8
+ import { Ndjson, SchemaBinary } from "effect/encoding"
9
9
 
10
10
  // SchemaBinary derives a framed binary decoder directly from a schema.
11
11
  export const schemaBinaryDecoder = SchemaBinary.decode(Schema.Struct({
@@ -5,8 +5,8 @@
5
5
  */
6
6
  import { NodeRuntime } from "@effect/platform-node"
7
7
  import { Context, Effect, Layer } from "effect"
8
- import { FetchHttpClient } from "effect/unstable/http"
9
- import { OtlpLogger, OtlpSerialization, OtlpTracer } from "effect/unstable/observability"
8
+ import { FetchHttpClient } from "effect/http"
9
+ import { OtlpLogger, OtlpSerialization, OtlpTracer } from "effect/observability"
10
10
 
11
11
  // Configure OTLP span export.
12
12
  export const OtlpTracingLayer = OtlpTracer.layer({
@@ -2,6 +2,6 @@
2
2
 
3
3
  Effect has built-in support for structured logging, distributed tracing, and
4
4
  metrics. For exporting telemetry, use the lightweight Otlp modules from
5
- `effect/unstable/observability` in new projects, or use
5
+ `effect/observability` in new projects, or use
6
6
  `@effect/opentelemetry` NodeSdk when integrating with an existing OpenTelemetry
7
7
  setup.
@@ -7,8 +7,8 @@
7
7
  import { NodeRuntime } from "@effect/platform-node"
8
8
  import { SqliteClient, SqliteMigrator } from "@effect/sql-sqlite-node"
9
9
  import { Context, Effect, Layer, Schema } from "effect"
10
- import { Model } from "effect/unstable/schema"
11
- import { SqlClient, SqlModel, SqlSchema } from "effect/unstable/sql"
10
+ import { Model } from "effect/schema"
11
+ import { SqlClient, SqlModel, SqlSchema } from "effect/sql"
12
12
 
13
13
  // Use a branded string for the group id, so it cannot be mixed up with other
14
14
  // string ids in the application.
@@ -1,6 +1,6 @@
1
1
  ## Working with SQL databases
2
2
 
3
- Use the `effect/unstable/sql` modules together with a driver package such as
3
+ Use the `effect/sql` modules together with a driver package such as
4
4
  `@effect/sql-sqlite-node` to access SQL databases. Define domain models with
5
5
  `Model.Class` to derive schemas for the database and JSON boundaries, run
6
6
  migrations, and write type-safe queries.
@@ -4,7 +4,7 @@
4
4
  * Define a service that uses the HttpClient module to fetch data from an external API
5
5
  */
6
6
  import { Context, Effect, flow, Layer, Schedule, Schema } from "effect"
7
- import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "effect/unstable/http"
7
+ import { FetchHttpClient, HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http"
8
8
 
9
9
  class Todo extends Schema.Class<Todo>("Todo")({
10
10
  userId: Schema.Int,
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { NodeHttpServer, NodeRuntime } from "@effect/platform-node"
8
8
  import { Context, Effect, flow, Layer, Schedule } from "effect"
9
- import { FetchHttpClient, HttpClient, HttpClientRequest, HttpRouter, HttpServer } from "effect/unstable/http"
10
- import { HttpApiBuilder, HttpApiClient, HttpApiMiddleware, HttpApiScalar } from "effect/unstable/httpapi"
9
+ import { FetchHttpClient, HttpClient, HttpClientRequest, HttpRouter, HttpServer } from "effect/http"
10
+ import { HttpApiBuilder, HttpApiClient, HttpApiMiddleware, HttpApiScalar } from "effect/http-api"
11
11
  import { createServer } from "node:http"
12
12
  // Api definitions should **always** be seperate from the server implementation,
13
13
  // so that they can be shared between the server and client without leaking
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { assert, layer } from "@effect/vitest"
8
8
  import { Effect, Layer } from "effect"
9
- import { HttpClientRequest, HttpServer } from "effect/unstable/http"
10
- import { HttpApiMiddleware, HttpApiTest } from "effect/unstable/httpapi"
9
+ import { HttpClientRequest, HttpServer } from "effect/http"
10
+ import { HttpApiMiddleware, HttpApiTest } from "effect/http-api"
11
11
  import { Api } from "./fixtures/api/Api.ts"
12
12
  import { Authorization } from "./fixtures/api/Authorization.ts"
13
13
  import { UserId } from "./fixtures/domain/User.ts"
@@ -1,4 +1,4 @@
1
- import { HttpApi, OpenApi } from "effect/unstable/httpapi"
1
+ import { HttpApi, OpenApi } from "effect/http-api"
2
2
  import { SystemApi } from "./System.ts"
3
3
  import { UsersApiGroup } from "./Users.ts"
4
4
 
@@ -1,5 +1,5 @@
1
1
  import { Context, Schema } from "effect"
2
- import { HttpApiMiddleware, HttpApiSecurity } from "effect/unstable/httpapi"
2
+ import { HttpApiMiddleware, HttpApiSecurity } from "effect/http-api"
3
3
  import type { User } from "../domain/User.ts"
4
4
 
5
5
  export class CurrentUser extends Context.Service<CurrentUser, User>()("acme/HttpApi/Authorization/CurrentUser") {}
@@ -1,4 +1,4 @@
1
- import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi"
1
+ import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api"
2
2
 
3
3
  // Top level groups are added to the root of the derived HttpApiClient.
4
4
  //
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect"
2
- import { HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi"
2
+ import { HttpApiEndpoint, HttpApiError, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/http-api"
3
3
  import { User, UserId } from "../domain/User.ts"
4
4
  import { SearchQueryTooShort, UserNotFound } from "../domain/UserErrors.ts"
5
5
  import { Authorization } from "./Authorization.ts"
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "effect"
2
- import { Model } from "effect/unstable/schema"
2
+ import { Model } from "effect/schema"
3
3
 
4
4
  export const UserId = Schema.String.pipe(Schema.brand("UserId"))
5
5
  export type UserId = typeof UserId.Type
@@ -1,5 +1,5 @@
1
1
  import { Effect, Layer } from "effect"
2
- import { HttpApiBuilder, HttpApiError } from "effect/unstable/httpapi"
2
+ import { HttpApiBuilder, HttpApiError } from "effect/http-api"
3
3
  import { Api } from "../../api/Api.ts"
4
4
  import { CurrentUser } from "../../api/Authorization.ts"
5
5
  import { AuthorizationLayer } from "../Authorization.ts"
@@ -1,6 +1,6 @@
1
1
  import { SqliteClient, SqliteMigrator } from "@effect/sql-sqlite-node"
2
2
  import { Context, Effect, Layer, Schema } from "effect"
3
- import { SqlClient, SqlModel, SqlSchema } from "effect/unstable/sql"
3
+ import { SqlClient, SqlModel, SqlSchema } from "effect/sql"
4
4
  import { User } from "../domain/User.ts"
5
5
  import type { UserId } from "../domain/User.ts"
6
6
  import { SearchQueryTooShort, UserNotFound, UsersError } from "../domain/UserErrors.ts"
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { NodeServices } from "@effect/platform-node"
7
7
  import { Console, Context, Effect, Layer, Schema, Stream, String } from "effect"
8
- import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process"
8
+ import { ChildProcess, ChildProcessSpawner } from "effect/process"
9
9
 
10
10
  export class DevToolsError extends Schema.TaggedError<DevToolsError>()("DevToolsError", {
11
11
  cause: Schema.Defect()
@@ -1,3 +1,3 @@
1
1
  ## Working with child processes
2
2
 
3
- Use the `effect/unstable/process` modules to define child processes and run them with `ChildProcessSpawner`.
3
+ Use the `effect/process` modules to define child processes and run them with `ChildProcessSpawner`.
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { NodeRuntime, NodeServices } from "@effect/platform-node"
8
8
  import { Console, Effect, Option, Schema } from "effect"
9
- import { Argument, Command, Flag } from "effect/unstable/cli"
9
+ import { Argument, Command, Flag } from "effect/cli"
10
10
 
11
11
  // You can define flags outside of commands and reuse them across multiple
12
12
  // commands.
@@ -1,5 +1,5 @@
1
1
  ## Building CLI applications
2
2
 
3
- Use the "effect/unstable/cli" modules to build CLI applications. These modules
3
+ Use the "effect/cli" modules to build CLI applications. These modules
4
4
  provide utilities for parsing command-line arguments, handling user input, and
5
5
  managing the flow of a CLI application.
@@ -7,8 +7,8 @@
7
7
  import { AnthropicClient, AnthropicLanguageModel } from "@effect/ai-anthropic"
8
8
  import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai"
9
9
  import { Config, Context, Effect, ExecutionPlan, Layer, Schema, Stream } from "effect"
10
- import { AiError, LanguageModel, Model, type Response } from "effect/unstable/ai"
11
- import { FetchHttpClient } from "effect/unstable/http"
10
+ import { AiError, LanguageModel, Model, type Response } from "effect/ai"
11
+ import { FetchHttpClient } from "effect/http"
12
12
  import { LaunchPlan } from "./fixtures/domain/LaunchPlan.ts"
13
13
 
14
14
  // You can use Config to create ai clients
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { OpenAiClient, OpenAiLanguageModel, OpenAiTool } from "@effect/ai-openai"
8
8
  import { Config, Context, Effect, Layer, Schema } from "effect"
9
- import { AiError, LanguageModel, Tool, Toolkit } from "effect/unstable/ai"
10
- import { FetchHttpClient } from "effect/unstable/http"
9
+ import { AiError, LanguageModel, Tool, Toolkit } from "effect/ai"
10
+ import { FetchHttpClient } from "effect/http"
11
11
 
12
12
  // ---------------------------------------------------------------------------
13
13
  // 1. Defining tools
@@ -6,8 +6,8 @@
6
6
  */
7
7
  import { OpenAiClient, OpenAiLanguageModel } from "@effect/ai-openai"
8
8
  import { Config, Context, DateTime, Effect, Layer, Ref, Schema } from "effect"
9
- import { AiError, Chat, Prompt, Tool, Toolkit } from "effect/unstable/ai"
10
- import { FetchHttpClient } from "effect/unstable/http"
9
+ import { AiError, Chat, Prompt, Tool, Toolkit } from "effect/ai"
10
+ import { FetchHttpClient } from "effect/http"
11
11
 
12
12
  // ---------------------------------------------------------------------------
13
13
  // Provider setup
@@ -5,9 +5,9 @@
5
5
  */
6
6
  import { NodeClusterSocket, NodeRuntime } from "@effect/platform-node"
7
7
  import { Effect, Layer, Ref, Schema } from "effect"
8
- import { ClusterSchema, Entity, TestRunner } from "effect/unstable/cluster"
9
- import { Rpc } from "effect/unstable/rpc"
10
- import type { SqlClient } from "effect/unstable/sql"
8
+ import { ClusterSchema, Entity, TestRunner } from "effect/cluster"
9
+ import { Rpc } from "effect/rpc"
10
+ import type { SqlClient } from "effect/sql"
11
11
 
12
12
  export const Increment = Rpc.make("Increment", {
13
13
  payload: { amount: Schema.Int },
@@ -2,9 +2,9 @@ import * as Config from "effect/Config";
2
2
  import * as Context from "effect/Context";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as Layer from "effect/Layer";
5
- import * as Scope from "effect/Scope";
6
- import * as Reactivity from "effect/unstable/reactivity/Reactivity";
7
- import * as Client from "effect/unstable/sql/SqlClient";
5
+ import * as Reactivity from "effect/reactivity/Reactivity";
6
+ import type * as Scope from "effect/Scope";
7
+ import * as Client from "effect/sql/SqlClient";
8
8
  /**
9
9
  * Runtime identifier attached to SQLite React Native client values.
10
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteClient.d.ts","sourceRoot":"","sources":["../src/SqliteClient.ts"],"names":[],"mappings":"AAcA,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;AAsBvD;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,MAAwD,CAAA;AAE7E;;;;;GAKG;AACH,MAAM,MAAM,MAAM,GAAG,+CAA+C,CAAA;AAEpE;;;;;GAKG;AACH,MAAM,WAAW,YA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S,CAAA;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAA;IAC7D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;IACrE,QAAQ,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,CAAA;CACrE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,4BAGtB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,2CACrB,CAAA;AAIjD;;;;;GAKG;AACH,eAAO,MAAM,IAAI,YACN,kBAAkB,KAC1B,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,UAAU,CA8GrE,CAAA;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,WAAW,WACd,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,KACtC,KAAK,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,WAAW,CAUzB,CAAA;AAEzC;;;;;GAKG;AACH,eAAO,MAAM,KAAK,WACR,kBAAkB,KACzB,KAAK,CAAC,KAAK,CAAC,YAAY,GAAG,MAAM,CAAC,SAAS,CAML,CAAA"}
@@ -15,16 +15,14 @@ import * as Sqlite from "@op-engineering/op-sqlite";
15
15
  import * as Config from "effect/Config";
16
16
  import * as Context from "effect/Context";
17
17
  import * as Effect from "effect/Effect";
18
- import * as Fiber from "effect/Fiber";
19
18
  import { constFalse, identity } from "effect/Function";
20
19
  import * as Layer from "effect/Layer";
21
- import * as Scope from "effect/Scope";
20
+ import * as Reactivity from "effect/reactivity/Reactivity";
22
21
  import * as Semaphore from "effect/Semaphore";
22
+ import * as Client from "effect/sql/SqlClient";
23
+ import { classifySqliteError, SqlError } from "effect/sql/SqlError";
24
+ import * as Statement from "effect/sql/Statement";
23
25
  import * as Stream from "effect/Stream";
24
- import * as Reactivity from "effect/unstable/reactivity/Reactivity";
25
- import * as Client from "effect/unstable/sql/SqlClient";
26
- import { classifySqliteError, SqlError } from "effect/unstable/sql/SqlError";
27
- import * as Statement from "effect/unstable/sql/Statement";
28
26
  const ATTR_DB_SYSTEM_NAME = "db.system.name";
29
27
  const open = Sqlite.open;
30
28
  const classifyError = (cause, message, operation) => classifySqliteError(cause, {
@@ -140,18 +138,19 @@ export const make = options => Effect.gen(function* () {
140
138
  }
141
139
  });
142
140
  });
143
- const semaphore = yield* Semaphore.make(1);
144
- const connection = yield* makeConnection;
145
- const acquirer = semaphore.withPermits(1)(Effect.succeed(connection));
146
- const transactionAcquirer = Effect.uninterruptibleMask(restore => {
147
- const fiber = Fiber.getCurrent();
148
- const scope = Context.getUnsafe(fiber.context, Scope.Scope);
149
- return Effect.as(Effect.tap(restore(semaphore.take(1)), () => Scope.addFinalizer(scope, semaphore.release(1))), connection);
141
+ const {
142
+ acquirer,
143
+ onCommitFailure,
144
+ transactionAcquirer
145
+ } = Client.makeSqliteAcquirers({
146
+ connection: Effect.succeed(yield* makeConnection),
147
+ semaphore: yield* Semaphore.make(1)
150
148
  });
151
149
  return Object.assign(yield* Client.make({
152
150
  acquirer,
153
151
  compiler,
154
152
  transactionAcquirer,
153
+ onCommitFailure,
155
154
  releaseSavepoint: name => `RELEASE SAVEPOINT ${name}`,
156
155
  spanAttributes: [...(options.spanAttributes ? Object.entries(options.spanAttributes) : []), [ATTR_DB_SYSTEM_NAME, "sqlite"]],
157
156
  transformRows
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteClient.js","names":[],"sources":["../src/SqliteClient.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;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AY,EAAE,MAAM,CAAC,CAAC,IAAI,CACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CACtC,CACF,CACF,CACF,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAEzC;;;;;;AAMA,OAAO,MAAM,KAAK,GAChB,MAA0B,IAE1B,KAAK,CAAC,aAAa,CACjB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,EAAG,MAAM,IAC9B,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,IAAI,CACrC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CACtC,CAAC,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
@@ -21,13 +21,13 @@
21
21
  */
22
22
  import type * as Effect from "effect/Effect";
23
23
  import * as Layer from "effect/Layer";
24
- import * as Migrator from "effect/unstable/sql/Migrator";
25
- import type * as Client from "effect/unstable/sql/SqlClient";
26
- import type { SqlError } from "effect/unstable/sql/SqlError";
24
+ import * as Migrator from "effect/sql/Migrator";
25
+ import type * as Client from "effect/sql/SqlClient";
26
+ import type { SqlError } from "effect/sql/SqlError";
27
27
  /**
28
28
  * @since 4.0.0
29
29
  */
30
- export * from "effect/unstable/sql/Migrator";
30
+ export * from "effect/sql/Migrator";
31
31
  /**
32
32
  * Runs SQL migrations for a React Native SQLite database using the shared `Migrator` implementation and the current `SqlClient`.
33
33
  *
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteMigrator.d.ts","sourceRoot":"","sources":["../src/SqliteMigrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AAC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,CAAC,KACjC,MAAM,CAAC,MAAM,CAChB,aAAa,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,EAClD,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAClC,MAAM,CAAC,SAAS,GAAG,CAAC,CACD,CAAA;AAErB;;;;;GAKG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,WACZ,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,KACnC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,QAAQ,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC,GAAG,MAAM,CAAC,SAAS,CAAsC,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import * as Layer from "effect/Layer";
2
- import * as Migrator from "effect/unstable/sql/Migrator";
2
+ import * as Migrator from "effect/sql/Migrator";
3
3
  /**
4
4
  * @since 4.0.0
5
5
  */
6
- export * from "effect/unstable/sql/Migrator";
6
+ export * from "effect/sql/Migrator";
7
7
  /**
8
8
  * Runs SQL migrations for a React Native SQLite database using the shared `Migrator` implementation and the current `SqlClient`.
9
9
  *
@@ -1 +1 @@
1
- {"version":3,"file":"SqliteMigrator.js","names":[],"sources":["../src/SqliteMigrator.ts"],"sourcesContent":[null],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,QAAQ,MAAM,8BAA8B;AAIxD;;;AAGA,cAAc,8BAA8B;AAE5C;;;;;;AAMA,OAAO,MAAM,GAAG,gBAMZ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAErB;;;;;;AAMA,OAAO,MAAM,KAAK,GAChB,OAAoC,IAC6C,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"SqliteMigrator.js","names":[],"sources":["../src/SqliteMigrator.ts"],"sourcesContent":[null],"mappings":"AAsBA,OAAO,KAAK,KAAK,MAAM,cAAc;AACrC,OAAO,KAAK,QAAQ,MAAM,qBAAqB;AAI/C;;;AAGA,cAAc,qBAAqB;AAEnC;;;;;;AAMA,OAAO,MAAM,GAAG,gBAMZ,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;AAErB;;;;;;AAMA,OAAO,MAAM,KAAK,GAChB,OAAoC,IAC6C,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effect/sql-sqlite-react-native",
3
- "version": "4.0.0-rc.117",
3
+ "version": "4.0.0-rc.118",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "A SQLite toolkit for Effect",
@@ -47,12 +47,12 @@
47
47
  "provenance": true
48
48
  },
49
49
  "devDependencies": {
50
- "@op-engineering/op-sqlite": "^18.2.4",
51
- "effect": "^4.0.0-rc.117"
50
+ "@op-engineering/op-sqlite": "^18.2.5",
51
+ "effect": "^4.0.0-rc.118"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@op-engineering/op-sqlite": ">=17.1.2 <18.0.0",
55
- "effect": "^4.0.0-rc.117"
55
+ "effect": "^4.0.0-rc.118"
56
56
  },
57
57
  "scripts": {
58
58
  "codegen": "effect-utils codegen",
@@ -15,17 +15,16 @@ import * as Sqlite from "@op-engineering/op-sqlite"
15
15
  import * as Config from "effect/Config"
16
16
  import * as Context from "effect/Context"
17
17
  import * as Effect from "effect/Effect"
18
- import * as Fiber from "effect/Fiber"
19
18
  import { constFalse, identity } from "effect/Function"
20
19
  import * as Layer from "effect/Layer"
21
- import * as Scope from "effect/Scope"
20
+ import * as Reactivity from "effect/reactivity/Reactivity"
21
+ import type * as Scope from "effect/Scope"
22
22
  import * as Semaphore from "effect/Semaphore"
23
+ import * as Client from "effect/sql/SqlClient"
24
+ import type { Connection } from "effect/sql/SqlConnection"
25
+ import { classifySqliteError, SqlError } from "effect/sql/SqlError"
26
+ import * as Statement from "effect/sql/Statement"
23
27
  import * as Stream from "effect/Stream"
24
- import * as Reactivity from "effect/unstable/reactivity/Reactivity"
25
- import * as Client from "effect/unstable/sql/SqlClient"
26
- import type { Connection } from "effect/unstable/sql/SqlConnection"
27
- import { classifySqliteError, SqlError } from "effect/unstable/sql/SqlError"
28
- import * as Statement from "effect/unstable/sql/Statement"
29
28
 
30
29
  const ATTR_DB_SYSTEM_NAME = "db.system.name"
31
30
 
@@ -219,20 +218,9 @@ export const make = (
219
218
  })
220
219
  })
221
220
 
222
- const semaphore = yield* Semaphore.make(1)
223
- const connection = yield* makeConnection
224
-
225
- const acquirer = semaphore.withPermits(1)(Effect.succeed(connection))
226
- const transactionAcquirer = Effect.uninterruptibleMask((restore) => {
227
- const fiber = Fiber.getCurrent()!
228
- const scope = Context.getUnsafe(fiber.context, Scope.Scope)
229
- return Effect.as(
230
- Effect.tap(
231
- restore(semaphore.take(1)),
232
- () => Scope.addFinalizer(scope, semaphore.release(1))
233
- ),
234
- connection
235
- )
221
+ const { acquirer, onCommitFailure, transactionAcquirer } = Client.makeSqliteAcquirers({
222
+ connection: Effect.succeed(yield* makeConnection),
223
+ semaphore: yield* Semaphore.make(1)
236
224
  })
237
225
 
238
226
  return Object.assign(
@@ -240,6 +228,7 @@ export const make = (
240
228
  acquirer,
241
229
  compiler,
242
230
  transactionAcquirer,
231
+ onCommitFailure,
243
232
  releaseSavepoint: (name) => `RELEASE SAVEPOINT ${name}`,
244
233
  spanAttributes: [
245
234
  ...(options.spanAttributes ? Object.entries(options.spanAttributes) : []),
@@ -21,14 +21,14 @@
21
21
  */
22
22
  import type * as Effect from "effect/Effect"
23
23
  import * as Layer from "effect/Layer"
24
- import * as Migrator from "effect/unstable/sql/Migrator"
25
- import type * as Client from "effect/unstable/sql/SqlClient"
26
- import type { SqlError } from "effect/unstable/sql/SqlError"
24
+ import * as Migrator from "effect/sql/Migrator"
25
+ import type * as Client from "effect/sql/SqlClient"
26
+ import type { SqlError } from "effect/sql/SqlError"
27
27
 
28
28
  /**
29
29
  * @since 4.0.0
30
30
  */
31
- export * from "effect/unstable/sql/Migrator"
31
+ export * from "effect/sql/Migrator"
32
32
 
33
33
  /**
34
34
  * Runs SQL migrations for a React Native SQLite database using the shared `Migrator` implementation and the current `SqlClient`.