@voltro/database 0.84.0 → 0.85.0

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.
@@ -5,66 +5,10 @@ property of its respective copyright holders and is used under the terms of
5
5
  its license. This file is provided for attribution; it grants no rights in
6
6
  @voltro/database itself, which is proprietary (see LICENSE).
7
7
 
8
- Generated from the resolved runtime dependency closure (6 packages).
8
+ Generated from the resolved runtime dependency closure (4 packages).
9
9
 
10
10
  ---
11
11
 
12
- ## @effect/experimental@0.61.1
13
-
14
- License: MIT
15
-
16
- ```
17
- MIT License
18
-
19
- Copyright (c) 2023-present The Contributors
20
-
21
- Permission is hereby granted, free of charge, to any person obtaining a copy
22
- of this software and associated documentation files (the "Software"), to deal
23
- in the Software without restriction, including without limitation the rights
24
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25
- copies of the Software, and to permit persons to whom the Software is
26
- furnished to do so, subject to the following conditions:
27
-
28
- The above copyright notice and this permission notice shall be included in all
29
- copies or substantial portions of the Software.
30
-
31
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37
- SOFTWARE.
38
- ```
39
-
40
- ## @effect/sql@0.52.1
41
-
42
- License: MIT
43
-
44
- ```
45
- MIT License
46
-
47
- Copyright (c) 2023-present The Contributors
48
-
49
- Permission is hereby granted, free of charge, to any person obtaining a copy
50
- of this software and associated documentation files (the "Software"), to deal
51
- in the Software without restriction, including without limitation the rights
52
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
- copies of the Software, and to permit persons to whom the Software is
54
- furnished to do so, subject to the following conditions:
55
-
56
- The above copyright notice and this permission notice shall be included in all
57
- copies or substantial portions of the Software.
58
-
59
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
- SOFTWARE.
66
- ```
67
-
68
12
  ## layerr@3.0.0
69
13
 
70
14
  License: MIT
package/dist/index.d.ts CHANGED
@@ -1,15 +1,17 @@
1
- import { ConfigError } from 'effect';
1
+ import { Config } from 'effect';
2
2
  import { Context } from 'effect';
3
+ import { Duration } from 'effect/Duration';
3
4
  import { Effect } from 'effect';
4
5
  import { Exit } from 'effect';
5
6
  import { Layer } from 'effect';
6
7
  import { Schedule } from 'effect';
7
8
  import { Schema } from 'effect';
8
- import { SqlClient } from '@effect/sql';
9
- import { SqlError } from '@effect/sql';
10
- import { Statement } from '@effect/sql';
9
+ import { SqlClient } from 'effect/sql';
10
+ import { SqlError } from 'effect/sql/SqlError';
11
+ import { SqlError as SqlError_2 } from 'effect/sql';
12
+ import { Statement } from 'effect/sql';
11
13
  import { Stream } from 'effect';
12
- import { TransactionConnection } from '@effect/sql/SqlClient';
14
+ import { TransactionConnection } from 'effect/sql/SqlClient';
13
15
  import { VoidIfEmpty } from 'effect/Types';
14
16
  import { YieldableError } from 'effect/Cause';
15
17
 
@@ -271,7 +273,7 @@ export declare const authoredError: (sentence: string, options?: {
271
273
  * error carries none — which is the case for everything a driver threw.
272
274
  *
273
275
  * Walks the same two structures `storeRefusalOf` does: every branch of an
274
- * Effect `Cause` (a `FiberFailure` hides its tree behind a symbol, so `.cause`
276
+ * Effect `Cause` (an `Exit` keeps its reasons in a list, so `.cause`
275
277
  * alone sees nothing), and then each branch's own `.cause` chain, because a
276
278
  * driver layer may have wrapped the refusal before Effect saw it. The FIRST
277
279
  * marked error wins — the outermost is the one that describes the operation
@@ -458,6 +460,11 @@ export declare interface BranchIndexName {
458
460
  * re-derived name is exactly what we do not know. */
459
461
  readonly columns: ReadonlyArray<string>;
460
462
  readonly unique: boolean;
463
+ /** A partial index's predicate as the parent's catalog prints it
464
+ * (`pg_get_expr`). Two indexes on the same columns — one plain, one
465
+ * `WHERE "readAt" IS NULL` — are told apart only by it; without it the
466
+ * restore can give each the other's name. */
467
+ readonly where?: string;
461
468
  /** The name the PARENT's index carries, and the one to restore. */
462
469
  readonly name: string;
463
470
  }
@@ -638,13 +645,13 @@ export declare type CaughtUpVerdict = 'caught-up' | 'behind';
638
645
  /**
639
646
  * Expand an error into the concrete failures behind it.
640
647
  *
641
- * A `FiberFailure` carries an Effect `Cause`, which is a TREE — a failure and a
642
- * defect and an interrupt can all be present at once — so following `.cause`
643
- * from the outside reaches none of them. Exported because anything that wants to
644
- * find something INSIDE a thrown Effect error needs this same expansion, and a
645
- * second copy of it is a second definition that nothing keeps in step. (Learned
646
- * the direct way: a framework refusal marked on an error was invisible to a
647
- * plain `.cause` walk the moment it came back through `runPromise`.)
648
+ * A `Cause` holds a flat list of reasons — a failure and a defect and an
649
+ * interrupt can all be present at once — so following `.cause` from the outside
650
+ * reaches none of them. Exported because anything that wants to find something
651
+ * INSIDE a failed Effect needs this same expansion, and a second copy of it is a
652
+ * second definition that nothing keeps in step. (Learned the direct way: a
653
+ * framework refusal marked on an error was invisible to a plain `.cause` walk
654
+ * the moment it came back through a promise boundary.)
648
655
  */
649
656
  export declare const causeBranches: (err: unknown, depth?: number) => ReadonlyArray<unknown>;
650
657
 
@@ -1018,9 +1025,11 @@ export declare class ColumnBuilder<TsType, Type extends ColumnType, HasDefault e
1018
1025
  private rejectIfRaw;
1019
1026
  nullable(): ColumnBuilder<TsType | null, Type, HasDefault>;
1020
1027
  /**
1021
- * Declare that this scalar id points outside the app's local database graph.
1028
+ * Declare that this scalar id has no single database foreign key target.
1022
1029
  * Use it for provider, gateway, hardware, polymorphic, or cross-installation
1023
1030
  * identifiers that intentionally must not become `reference()` columns.
1031
+ * A polymorphic target may live in this same database. The application
1032
+ * validates the target and cleans up orphans.
1024
1033
  * This is schema metadata only and does not change the SQL column.
1025
1034
  */
1026
1035
  externalId(): this;
@@ -1265,7 +1274,7 @@ export declare class ColumnBuilder<TsType, Type extends ColumnType, HasDefault e
1265
1274
  *
1266
1275
  * Two flavors:
1267
1276
  *
1268
- * - **SQL** (preferred, 95% case): pass an `@effect/sql` `Statement.Fragment`
1277
+ * - **SQL** (preferred, 95% case): pass an `effect/sql` `Statement.Fragment`
1269
1278
  * (a sql`...` template built with `Statement.make`), evaluated
1270
1279
  * server-side. Single round-trip, transactional, scales linearly.
1271
1280
  *
@@ -1478,7 +1487,8 @@ export declare interface ColumnDefinition<TsType, Type extends ColumnType = Colu
1478
1487
  */
1479
1488
  readonly fkAutoIndex?: boolean;
1480
1489
  /**
1481
- * This id-shaped scalar names something outside the local relational graph.
1490
+ * This id-shaped scalar deliberately has no single foreign key target,
1491
+ * including external-system ids and local polymorphic targets.
1482
1492
  * Set by `.externalId()` so schema audits do not guess a local FK from the
1483
1493
  * column name. Metadata only; it emits no constraint or DDL.
1484
1494
  */
@@ -1870,7 +1880,7 @@ export declare interface ColumnReference {
1870
1880
  * value through unchanged, so the mapping looked right in any test that only
1871
1881
  * checked a round trip. Take definitions from `table.fields`.
1872
1882
  */
1873
- export declare const columnSchema: <TsType, C extends ColumnType>(def: ColumnDefinition<TsType, C>) => Schema.Schema.Any;
1883
+ export declare const columnSchema: <TsType, C extends ColumnType>(def: ColumnDefinition<TsType, C>) => Schema.Top;
1874
1884
 
1875
1885
  /**
1876
1886
  * A column as seen by the planner: either declared in code (extracted
@@ -2135,6 +2145,9 @@ export declare const columnsPerRow: (rows: ReadonlyArray<Record<string, unknown>
2135
2145
 
2136
2146
  export declare type ColumnType = 'id' | 'text' | 'integer' | 'real' | 'decimal' | 'bigint' | 'boolean' | 'timestamp' | 'date' | 'json' | 'bytes' | 'reference' | 'vector' | 'enum' | 'array' | 'interval' | 'raw';
2137
2147
 
2148
+ /** The explicit committed-buffer identity, absent for ordinary/CDC events. */
2149
+ export declare const committedChangeBatchOf: (event: ChangeEvent) => object | undefined;
2150
+
2138
2151
  /** Exact comparison of fixed-point decimal strings, without a floating-point conversion. */
2139
2152
  export declare const compareDecimal: (left: unknown, right: unknown) => number | null;
2140
2153
 
@@ -2257,7 +2270,7 @@ export declare interface ConnectionConfig {
2257
2270
  * timer). The waiting half is UNBOUNDED by default and deliberately so —
2258
2271
  * see {@link ConnectionConfig.acquireQueueLimit} for the length bound
2259
2272
  * that exists, why it is opt-in, and what it costs.
2260
- * - **mssql** — establishment only. Maps to `@effect/sql-mssql`'s
2273
+ * - **mssql** — establishment only. Maps to `effect/sql-mssql`'s
2261
2274
  * `connectTimeout` (tedious connect + the boot `SELECT 1` probe); its
2262
2275
  * pool is an Effect `Pool` whose `get` has no timeout knob.
2263
2276
  * - **sqlite** — ignored. One in-process connection, no pool to exhaust.
@@ -2285,7 +2298,7 @@ export declare interface ConnectionConfig {
2285
2298
  * The event loop is never reached again: no timer fires, nothing drains the
2286
2299
  * queue that caused the rejection, and nothing is logged.
2287
2300
  *
2288
- * That caller is not hypothetical and not ours to fix: `@effect/cluster`
2301
+ * That caller is not hypothetical and not ours to fix: `effect/cluster`
2289
2302
  * releases shards one statement per shard (300 by default) and wraps each in
2290
2303
  * `Effect.eventually` — retry until success, no schedule, no delay, logged at
2291
2304
  * debug. On a `shardLockDisableAdvisory` (Galera / PXC) runner those releases
@@ -2314,7 +2327,7 @@ export declare interface ConnectionConfig {
2314
2327
  * node-postgres' `statement_timeout` pool option — a runaway query is cancelled
2315
2328
  * with SQLSTATE 57014, not merely disconnected. Every OTHER dialect currently
2316
2329
  * ACCEPTS the field but IGNORES it, and the honest reasons differ:
2317
- * - **mssql** — `@effect/sql-mssql` exposes only `connectTimeout` (connection
2330
+ * - **mssql** — `effect/sql-mssql` exposes only `connectTimeout` (connection
2318
2331
  * establishment), not tedious's per-request `requestTimeout`; mapping this
2319
2332
  * onto `connectTimeout` would bound the wrong phase, so it is left unwired
2320
2333
  * rather than wrong.
@@ -3530,6 +3543,9 @@ export declare interface DialectTransactionSpec {
3530
3543
  /** The store's `sql.withTransaction` — issues BEGIN/COMMIT/ROLLBACK and
3531
3544
  * provides `TransactionConnection`. */
3532
3545
  readonly withTransaction: <A>(effect: Effect.Effect<A, unknown, never>) => Effect.Effect<A, unknown, never>;
3546
+ /** The store's `sql.transactionService` — the key under which `withTransaction`
3547
+ * provides this client's `[Connection, depth]` (per-client in Effect 4). */
3548
+ readonly transactionService: Context.Service<TransactionConnection, TransactionConnection.Service>;
3533
3549
  /** The store's managed runtime, ALWAYS as `runPromiseExit` — `runPromise` is
3534
3550
  * the bug this file exists to prevent, so the shared bracket never sees one. */
3535
3551
  readonly runPromiseExit: <A>(effect: Effect.Effect<A, unknown, never>) => Promise<Exit.Exit<A, unknown>>;
@@ -3754,6 +3770,13 @@ export declare interface EagerRootPlan {
3754
3770
  readonly children: ReadonlyArray<EagerRelationNode>;
3755
3771
  }
3756
3772
 
3773
+ /**
3774
+ * Emit an explicitly committed buffer synchronously, preserving every row
3775
+ * event and its order. Batch identity is process-local metadata, never wire
3776
+ * payload or attribution. Never use for rows still being written.
3777
+ */
3778
+ export declare const emitCommittedChanges: (events: readonly ChangeEvent[], emit: (event: ChangeEvent) => void) => void;
3779
+
3757
3780
  declare type EmptyMerge = unknown;
3758
3781
 
3759
3782
  /**
@@ -3814,6 +3837,9 @@ export declare const encryptedColumnsOf: (table: TableLike) => ReadonlyArray<str
3814
3837
  */
3815
3838
  export declare const encryptFieldsForWrite: (row: Row, table: TableLike | undefined, cipher: FieldCipher | undefined, rowId?: unknown) => Row;
3816
3839
 
3840
+ /** Encrypt a bulk write with one metadata snapshot, retaining per-row AAD. */
3841
+ export declare const encryptFieldsForWriteBatch: (rows: ReadonlyArray<Row>, table: TableLike | undefined, cipher: FieldCipher | undefined) => ReadonlyArray<Row>;
3842
+
3817
3843
  /** Mark it finished — AFTER its `routeEvent` has registered, not after the
3818
3844
  * statement. That is the whole point: the window being closed is exactly the
3819
3845
  * gap between the committing statement and the registration. */
@@ -4131,7 +4157,7 @@ export declare interface FileMigration {
4131
4157
  export declare interface FileMigrationContext {
4132
4158
  /**
4133
4159
  * The escape hatch, and it asks for a reason. `raw('why')` returns the
4134
- * `@effect/sql` client — `sql.unsafe(...)`, `sql\`...\``,
4160
+ * `effect/sql` client — `sql.unsafe(...)`, `sql\`...\``,
4135
4161
  * `sql.onDialectOrElse({...})` — for the one thing neither `store` nor
4136
4162
  * `schema` expresses. The reason is required (an empty one throws), it is
4137
4163
  * what `voltro doctor` lists beside every migration that reaches for raw
@@ -5178,7 +5204,7 @@ export declare const makeNamespaceBranchExecutor: (sql: BranchSqlRunner) => Bran
5178
5204
  * every `Effect.withSpan` inside `transactional()` emits real spans.
5179
5205
  */
5180
5206
  export declare interface MakeStoreOptions {
5181
- readonly sqlLayer: Layer.Layer<SqlClient.SqlClient, ConfigError.ConfigError | SqlError.SqlError, never>;
5207
+ readonly sqlLayer: Layer.Layer<SqlClient.SqlClient, Config.ConfigError | SqlError_2.SqlError, never>;
5182
5208
  readonly tracerLayer?: Layer.Layer<never, never, never>;
5183
5209
  readonly changeStrategy?: ChangeStrategy;
5184
5210
  /** Postgres NOTIFY channel name when changeStrategy is 'cdc'. */
@@ -5338,7 +5364,7 @@ export declare class MigrationExpectationFailed extends Error {
5338
5364
  * `log` and the two probes the store can answer about its own shape
5339
5365
  * (`tableExists`, `columnExists`) work without one; each refusal names what to
5340
5366
  * do instead. Also raised at construction when what was handed in as `sql` is not
5341
- * an `@effect/sql` client, or when a SQL-backed store arrives without the
5367
+ * an `effect/sql` client, or when a SQL-backed store arrives without the
5342
5368
  * client it executes on — both are refused before a body can run rather
5343
5369
  * than surfacing as a TypeError from inside the first helper that touches
5344
5370
  * the client.
@@ -5786,6 +5812,15 @@ export declare interface OneRelation {
5786
5812
  readonly sourceKey?: string;
5787
5813
  }
5788
5814
 
5815
+ /**
5816
+ * Run `effect` ON a transaction captured by `runRetryingTransaction`: the
5817
+ * whole context the transaction's fiber had — `TransactionConnection` plus
5818
+ * the sql client's transaction semaphore a nested `withTransaction`
5819
+ * (savepoint) takes a permit from. A connection this module never saw is
5820
+ * provided on its own, which is all a plain statement needs.
5821
+ */
5822
+ export declare const onTransaction: <A, E, R>(effect: Effect.Effect<A, E, R>, transactionService: Context.Service<TransactionConnection, TransactionConnection.Service>, txn: TransactionConnectionContext) => Effect.Effect<A, E, Exclude<R, TransactionConnection>>;
5823
+
5789
5824
  export declare const or: (...predicates: ReadonlyArray<Predicate>) => OrPredicate;
5790
5825
 
5791
5826
  export declare interface OrderClause {
@@ -6003,7 +6038,7 @@ export declare interface PluginRefSpec {
6003
6038
  readonly onSoftDelete: boolean;
6004
6039
  }
6005
6040
 
6006
- /** The declared spec for a column builder, when it is a `pluginRef`. */
6041
+ /** The declared spec on a builder or its materialized column definition. */
6007
6042
  export declare const pluginRefSpecOf: (column: unknown) => PluginRefSpec | undefined;
6008
6043
 
6009
6044
  /** Postgres SQLSTATEs. */
@@ -6030,6 +6065,12 @@ export declare interface PredicateLeafWithContext extends PredicateLeaf {
6030
6065
  readonly conjunctive: boolean;
6031
6066
  }
6032
6067
 
6068
+ /** Prepare one synchronous evaluation pass. Recreate after mutating the AST or
6069
+ * its value arrays; no process-wide cache retains descriptors or row values. */
6070
+ export declare const preparePredicate: (predicate: Predicate, subqueries?: SubqueryResults | null, columns?: Readonly<Record<string, {
6071
+ readonly type: string;
6072
+ }>>) => ((row: Row | null) => boolean);
6073
+
6033
6074
  export declare interface PrimaryKeyConflictError {
6034
6075
  readonly _tag: 'PrimaryKeyConflictError';
6035
6076
  readonly table: string;
@@ -7468,7 +7509,7 @@ export declare const rowNumber: (alias?: string) => WindowBuilder;
7468
7509
  */
7469
7510
  export declare const rowSchema: <T extends TableLike>(table: T, options?: {
7470
7511
  readonly omit?: ReadonlyArray<string>;
7471
- }) => Schema.Schema.Any;
7512
+ }) => Schema.Top;
7472
7513
 
7473
7514
  /** The context a rule predicate is evaluated with. */
7474
7515
  export declare interface RuleContext {
@@ -7521,7 +7562,7 @@ export declare interface RuleViolationDetail {
7521
7562
  * 1. the connection handshake — `withTransaction` + `TransactionConnection`,
7522
7563
  * with a loud failure rather than a silent non-transactional run when the
7523
7564
  * service is somehow absent;
7524
- * 2. **commit-defect promotion** — `@effect/sql` runs COMMIT as `Effect.orDie`,
7565
+ * 2. **commit-defect promotion** — `effect/sql` runs COMMIT as `Effect.orDie`,
7525
7566
  * so a serialization/deadlock error raised AT COMMIT arrives as a defect and
7526
7567
  * `Effect.retry` never sees it. A retryable defect is promoted back to a
7527
7568
  * typed failure so the schedule can replay it; anything else re-dies, so
@@ -7673,10 +7714,9 @@ export declare interface SchemaTable extends TableLike {
7673
7714
  /**
7674
7715
  * The plugin references DECLARED on this table, surviving `table()`.
7675
7716
  *
7676
- * `pluginRefSpecOf` reads a column BUILDER, and materialisation replaces it
7677
- * with a plain field descriptor — so without this the declaration is
7678
- * unreadable the moment the table exists, and any tool deriving structure
7679
- * from the schema sees an ordinary `text()` column.
7717
+ * Derived from column metadata on every table rebuild, including columns
7718
+ * contributed by mixins. Consumers can inspect these rules without knowing
7719
+ * the private metadata on each materialized scalar definition.
7680
7720
  */
7681
7721
  readonly appliedPluginRefs?: ReadonlyArray<{
7682
7722
  readonly column: string;
@@ -7893,7 +7933,7 @@ export declare const setTenantCreateSeedHook: (hook: TenantCreateSeedHook | null
7893
7933
 
7894
7934
  /**
7895
7935
  * Unwrap a transaction program's `Exit`: return the value, or throw the
7896
- * ORIGINAL error rather than Effect's `FiberFailure` wrapper.
7936
+ * ORIGINAL error rather than a squashed or wrapped one.
7897
7937
  *
7898
7938
  * Use with `runtime.runPromiseExit`, never `runPromise` — the wrapper is
7899
7939
  * created by `runPromise` itself, so there is nothing left to unwrap by the
@@ -7902,7 +7942,7 @@ export declare const setTenantCreateSeedHook: (hook: TenantCreateSeedHook | null
7902
7942
  * `Cause.squash` is what preserves the typing: for a `Fail` it yields the value
7903
7943
  * that was thrown (the app's `TaggedError`, so the rpc encoder can still match
7904
7944
  * it against the descriptor's `error:` schema); for a `Die` the defect; for an
7905
- * interrupt an `InterruptedException`. Retry filtering has already run inside
7945
+ * interrupt an `Error` ("All fibers interrupted without error"). Retry filtering has already run inside
7906
7946
  * the program, so an Exit reaching here is final.
7907
7947
  */
7908
7948
  export declare const settleTransactionExit: <A>(exit: Exit.Exit<A, unknown>) => A;
@@ -7921,6 +7961,14 @@ export declare const settleVersionedUpdate: (input: {
7921
7961
  readonly current: number | null;
7922
7962
  }) => VersionConflict | undefined;
7923
7963
 
7964
+ /** ONE transaction context key for every SQL client a process builds, whatever
7965
+ * the dialect: v4 keys `TransactionConnection` per client, so a statement issued
7966
+ * through a second client (another layer build, a plugin's own runtime) inside a
7967
+ * store transaction would otherwise take a fresh pool connection — outside the
7968
+ * transaction, and a deadlock when the pool is small. node-postgres shared one
7969
+ * tag; every dialect layer passes this key to its client. */
7970
+ export declare const SHARED_TRANSACTION_SERVICE: Context.Service<SqlClient.TransactionConnection, TransactionConnection.Service>;
7971
+
7924
7972
  /** When a `<name>__dropped_<YYYYMMDDHHMMSS>` snapshot was taken (UTC), or
7925
7973
  * `undefined` for a name that is not one. */
7926
7974
  export declare const softDropSnapshotStamp: (name: string) => Date | undefined;
@@ -8002,7 +8050,7 @@ export declare type SqlConstructor = Statement.Constructor;
8002
8050
  * `id` is the canonical name surfaced in logs, boot banners, error
8003
8051
  * messages, and the `DB_DIALECT` env value.
8004
8052
  *
8005
- * `makeSqlLayer` constructs the `@effect/sql` connection Layer from a
8053
+ * `makeSqlLayer` constructs the `effect/sql` connection Layer from a
8006
8054
  * generic `ConnectionConfig`. Each dialect maps the config to its own
8007
8055
  * driver's expected shape.
8008
8056
  *
@@ -8028,12 +8076,14 @@ export declare interface SqlDialect {
8028
8076
  */
8029
8077
  readonly workflowRunnerStorage?: (connection: ConnectionConfig) => 'memory' | 'sql';
8030
8078
  readonly id: DialectId;
8031
- readonly makeSqlLayer: (conn: ConnectionConfig) => Layer.Layer<SqlClient.SqlClient, ConfigError.ConfigError | SqlError.SqlError, never>;
8079
+ readonly makeSqlLayer: (conn: ConnectionConfig) => Layer.Layer<SqlClient.SqlClient, Config.ConfigError | SqlError_2.SqlError, never>;
8032
8080
  readonly makeStore: (options: MakeStoreOptions) => Promise<DataStore>;
8033
8081
  readonly compileContains: (col: Statement.Identifier, value: string, sql: Statement.Constructor) => Statement.Fragment;
8034
8082
  readonly retryFilter: (error: unknown) => RetryDecision;
8035
8083
  }
8036
8084
 
8085
+ export declare const sqlError: (message: string, cause?: unknown) => SqlError;
8086
+
8037
8087
  /** SQLite / turso result codes — symbolic and numeric spellings. */
8038
8088
  export declare const SQLITE_TRANSIENT_CODES: ReadonlySet<string>;
8039
8089
 
@@ -8363,10 +8413,9 @@ export declare interface Table<Name extends string, Fields extends Record<string
8363
8413
  /**
8364
8414
  * The plugin references DECLARED on this table, surviving `table()`.
8365
8415
  *
8366
- * `pluginRefSpecOf` reads a column BUILDER, and materialisation replaces it
8367
- * with a plain field descriptor — so without this the declaration is
8368
- * unreadable the moment the table exists, and any tool deriving structure
8369
- * from the schema sees an ordinary `text()` column.
8416
+ * Derived from column metadata on every table rebuild, including columns
8417
+ * contributed by mixins. Consumers can inspect these rules without knowing
8418
+ * the private metadata on each materialized scalar definition.
8370
8419
  */
8371
8420
  readonly appliedPluginRefs?: ReadonlyArray<{
8372
8421
  readonly column: string;
@@ -8413,7 +8462,7 @@ export declare interface Table<Name extends string, Fields extends Record<string
8413
8462
  * BEFORE every INSERT. Populated by `.validate(schema)`. Set
8414
8463
  * per-table at table-construction time; immutable thereafter.
8415
8464
  */
8416
- readonly insertSchema?: Schema.Schema.Any;
8465
+ readonly insertSchema?: Schema.Top;
8417
8466
  /**
8418
8467
  * Optional `effect/Schema` the framework decodes a patch against
8419
8468
  * BEFORE every UPDATE. Populated by `.validatePatch(schema)`. The
@@ -8422,7 +8471,7 @@ export declare interface Table<Name extends string, Fields extends Record<string
8422
8471
  * are checked. Set per-table at table-construction time; immutable
8423
8472
  * thereafter.
8424
8473
  */
8425
- readonly validatePatchSchema?: Schema.Schema.Any;
8474
+ readonly validatePatchSchema?: Schema.Top;
8426
8475
  with: <const Mixins extends ReadonlyArray<AnyMixin>>(...mixins: Mixins) => Table<Name, Fields & MergeMixinFields<Mixins>, Reactive, IxNames>;
8427
8476
  /**
8428
8477
  * Attach an effect/Schema that validates EVERY insert against the
@@ -8450,7 +8499,7 @@ export declare interface Table<Name extends string, Fields extends Record<string
8450
8499
  * `id` and `createdAt` are already filled in by the time the
8451
8500
  * decoder sees the row.
8452
8501
  */
8453
- validate: <S extends Schema.Schema.Any>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
8502
+ validate: <S extends Schema.Top>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
8454
8503
  /**
8455
8504
  * Attach an effect/Schema that validates UPDATE patches against the
8456
8505
  * table. The framework wraps the schema in `Schema.partial`, so a
@@ -8481,7 +8530,7 @@ export declare interface Table<Name extends string, Fields extends Record<string
8481
8530
  * wrapping is applied for you, so don't pre-wrap fields in
8482
8531
  * `Schema.optional`.
8483
8532
  */
8484
- validatePatch: <S extends Schema.Schema.Any>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
8533
+ validatePatch: <S extends Schema.Struct<Schema.Struct.Fields>>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
8485
8534
  /**
8486
8535
  * Declare a (possibly composite) secondary index on the table.
8487
8536
  *
@@ -9075,7 +9124,7 @@ export declare const timestamp: () => ColumnBuilder<Date, "timestamp", boolean>;
9075
9124
  * There is deliberately no `timestampMsOptional`: an absent field is
9076
9125
  * `Schema.optional(timestampMs)`, which composes without a third export.
9077
9126
  */
9078
- export declare const timestampMs: Schema.Schema<Date, number>;
9127
+ export declare const timestampMs: Schema.Codec<Date, number>;
9079
9128
 
9080
9129
  /**
9081
9130
  * `timestampMs` for a NULLABLE timestamp column — `Date | null` in the
@@ -9087,7 +9136,7 @@ export declare const timestampMs: Schema.Schema<Date, number>;
9087
9136
  * instead of as nothing. Mirrors what `columnSchema` does for a
9088
9137
  * `.nullable()` timestamp.
9089
9138
  */
9090
- export declare const timestampMsOrNull: Schema.Schema<Date | null, number | null>;
9139
+ export declare const timestampMsOrNull: Schema.Codec<Date | null, number | null>;
9091
9140
 
9092
9141
  /**
9093
9142
  * `transactional()`'s work caught a statement failure the engine had already
@@ -9173,14 +9222,14 @@ export declare class TransactionBrokenByBodyError extends Error {
9173
9222
  }
9174
9223
 
9175
9224
  /**
9176
- * The `[Connection, depth]` tuple `@effect/sql` provides inside
9225
+ * The `[Connection, depth]` tuple `effect/sql` provides inside
9177
9226
  * `withTransaction`. Every statement that must run on the transaction's OWN
9178
9227
  * connection (rather than a fresh one from the pool) is given this explicitly.
9179
9228
  */
9180
- export declare type TransactionConnectionContext = Context.Tag.Service<typeof TransactionConnection>;
9229
+ export declare type TransactionConnectionContext = TransactionConnection.Service;
9181
9230
 
9182
9231
  /** Shared bounded contention policy, including stores without a SQL connection. */
9183
- export declare const transactionRetrySchedule: (isRetryable: (error: unknown) => boolean) => Schedule.Schedule<number, unknown, never>;
9232
+ export declare const transactionRetrySchedule: (isRetryable: (error: unknown) => boolean) => Schedule.Schedule< Duration, unknown, never, never>;
9184
9233
 
9185
9234
  /** Turso's MVCC conflicts arrive as messages, not codes. */
9186
9235
  export declare const TURSO_TRANSIENT_MESSAGE: RegExp;
@@ -9573,16 +9622,14 @@ export declare const versionColumnOf: (columns: Readonly<Record<string, {
9573
9622
  export declare class VersionConflict extends VersionConflict_base {
9574
9623
  }
9575
9624
 
9576
- declare const VersionConflict_base: Schema.TaggedErrorClass<VersionConflict, "VersionConflict", {
9577
- readonly _tag: Schema.tag<"VersionConflict">;
9578
- } & {
9579
- table: typeof Schema.String;
9580
- id: typeof Schema.String;
9625
+ declare const VersionConflict_base: Schema.Class<VersionConflict, Schema.TaggedStruct<"VersionConflict", {
9626
+ readonly table: Schema.String;
9627
+ readonly id: Schema.String;
9581
9628
  /** What the caller believed the row was at. */
9582
- expected: typeof Schema.Number;
9629
+ readonly expected: Schema.Number;
9583
9630
  /** What it is actually at. `null` when the row is gone entirely. */
9584
- actual: Schema.NullOr<typeof Schema.Number>;
9585
- }>;
9631
+ readonly actual: Schema.NullOr<Schema.Number>;
9632
+ }>, YieldableError>;
9586
9633
 
9587
9634
  /**
9588
9635
  * A read-only SQL view descriptor. Structurally a `TableLike` (carries
@@ -9850,8 +9897,8 @@ export declare interface WindowSpec {
9850
9897
  * echoes the duplicate value, mssql echoes the truncated one. A cause that
9851
9898
  * forwards the sentence ships row contents to whoever provoked the failure.
9852
9899
  *
9853
- * `StoreOperationFailed.cause` did exactly that: `String(error)` on a
9854
- * `FiberFailure`, which is the message AND the stack, so an absolute server
9900
+ * `StoreOperationFailed.cause` did exactly that: `String(error)` on the
9901
+ * rejection, which is the message AND the stack, so an absolute server
9855
9902
  * path reached any caller that declared the error and every subscriber on a
9856
9903
  * stream carrying it.
9857
9904
  *