@voltro/database 0.84.0 → 0.86.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.
Files changed (170) hide show
  1. package/CHANGELOG.md +1215 -0
  2. package/THIRD-PARTY-NOTICES.md +5 -89
  3. package/dist/actorSnapshot.js +24 -0
  4. package/dist/arrayCodec.js +32 -0
  5. package/dist/branchExecute.js +92 -0
  6. package/dist/branching.js +106 -0
  7. package/dist/bulkInsertLimits.js +25 -0
  8. package/dist/cdcOffsetsTables.js +19 -0
  9. package/dist/changeEvent.js +41 -0
  10. package/dist/changeIdentity.js +65 -0
  11. package/dist/changeListenerCeiling.js +6 -0
  12. package/dist/columnReference.js +17 -0
  13. package/dist/columns.js +326 -0
  14. package/dist/committedChanges.js +12 -0
  15. package/dist/connectionIdentity.js +36 -0
  16. package/dist/coreTables.js +16 -0
  17. package/dist/coreTablesRegistry.js +10 -0
  18. package/dist/dataTransfers.js +22 -0
  19. package/dist/dbCause.js +222 -0
  20. package/dist/dbMetrics.js +65 -0
  21. package/dist/decimalComparison.js +27 -0
  22. package/dist/derivedRowId.js +5 -0
  23. package/dist/dialect.js +13 -0
  24. package/dist/enumRenames.js +14 -0
  25. package/dist/expiresMixin.js +10 -0
  26. package/dist/fieldEncryption.js +98 -0
  27. package/dist/frameworkTables.js +130 -0
  28. package/dist/ginIndex.js +10 -0
  29. package/dist/hybridSearch.js +32 -0
  30. package/dist/idGenerator.js +57 -0
  31. package/dist/identifierLimits.js +32 -0
  32. package/dist/index.d.ts +122 -64
  33. package/dist/index.js +81 -2080
  34. package/dist/indexAudit.js +61 -0
  35. package/dist/indexStorage.js +58 -0
  36. package/dist/joinCompiler.js +160 -0
  37. package/dist/jsonEagerCompiler.js +436 -0
  38. package/dist/jsonPatch.js +78 -0
  39. package/dist/jsonPatchAssignments.js +13 -0
  40. package/dist/jsonPath.js +31 -0
  41. package/dist/localFirstMixin.js +12 -0
  42. package/dist/migrate.js +624 -0
  43. package/dist/migration.js +18 -0
  44. package/dist/migrations/appliedAtValue.js +8 -0
  45. package/dist/migrations/applier.js +1085 -0
  46. package/dist/migrations/boot.js +196 -0
  47. package/dist/migrations/branchRehearsal.js +122 -0
  48. package/dist/migrations/columnEquivalence.js +85 -0
  49. package/dist/migrations/ddlError.js +63 -0
  50. package/dist/migrations/declaredSchema.js +162 -0
  51. package/dist/migrations/deployLedger.js +19 -0
  52. package/dist/migrations/fileBased.js +57 -0
  53. package/dist/migrations/fileContext.js +482 -0
  54. package/dist/migrations/fileDiscovery.js +318 -0
  55. package/dist/migrations/fileSkipProbes.js +117 -0
  56. package/dist/migrations/fingerprint.js +46 -0
  57. package/dist/migrations/fkCycles.js +13 -0
  58. package/dist/migrations/frameworkLiveTables.js +25 -0
  59. package/dist/migrations/idempotentDdl.js +37 -0
  60. package/dist/migrations/indexPredicate.js +50 -0
  61. package/dist/migrations/introspect.js +799 -0
  62. package/dist/migrations/ledgerRows.js +4 -0
  63. package/dist/migrations/lock.js +91 -0
  64. package/dist/migrations/migrationTableExists.js +9 -0
  65. package/dist/migrations/mssqlColumnDependencies.js +76 -0
  66. package/dist/migrations/mysqlEngine.js +11 -0
  67. package/dist/migrations/namespaceCharset.js +51 -0
  68. package/dist/migrations/planner.js +775 -0
  69. package/dist/migrations/postgresEnumCheck.js +19 -0
  70. package/dist/migrations/reactiveTriggerDrift.js +58 -0
  71. package/dist/migrations/reactiveTriggerName.js +7 -0
  72. package/dist/migrations/renameMssqlCheck.js +21 -0
  73. package/dist/migrations/restoreSnapshots.js +206 -0
  74. package/dist/migrations/resumeLedger.js +86 -0
  75. package/dist/migrations/rollingDeploy.js +106 -0
  76. package/dist/migrations/schemaOwner.js +46 -0
  77. package/dist/migrations/schemaOwnerTable.js +4 -0
  78. package/dist/migrations/softDropSnapshot.js +20 -0
  79. package/dist/migrations/sqlLimit.js +8 -0
  80. package/dist/migrations/sqliteConstraintIdentity.js +97 -0
  81. package/dist/migrations/sqliteDecimalBoot.js +22 -0
  82. package/dist/migrations/sqliteDecimalPublication.js +257 -0
  83. package/dist/migrations/sqliteDecimalReview.js +30 -0
  84. package/dist/migrations/sqliteDecimalReviewStore.js +188 -0
  85. package/dist/migrations/sqliteDecimalReviewWitness.js +38 -0
  86. package/dist/migrations/sqliteDecimalSource.js +69 -0
  87. package/dist/migrations/sqliteDecimalStage.js +135 -0
  88. package/dist/migrations/sqliteForeignKeys.js +38 -0
  89. package/dist/migrations/sqliteMigrationBatch.js +37 -0
  90. package/dist/migrations/sqliteRetainedSource.js +106 -0
  91. package/dist/migrations/sqliteRowIdentity.js +63 -0
  92. package/dist/migrations/sqliteSchemaEpoch.js +12 -0
  93. package/dist/migrations/sqliteSnapshotGuard.js +10 -0
  94. package/dist/migrations/sqliteTableContents.js +34 -0
  95. package/dist/migrations/sqliteTableCopy.js +25 -0
  96. package/dist/migrations/sqliteTableSchema.js +19 -0
  97. package/dist/migrations/sqliteWitnessProtection.js +8 -0
  98. package/dist/migrations/squash.js +81 -0
  99. package/dist/migrations/storeCharset.js +66 -0
  100. package/dist/migrations/transactionCause.js +10 -0
  101. package/dist/migrations/undeclaredCharset.js +40 -0
  102. package/dist/migrations/uniqueActiveLowering.js +39 -0
  103. package/dist/mixins.js +22 -0
  104. package/dist/mssqlDecimalDistinct.js +51 -0
  105. package/dist/mssqlJsonValueCheck.js +42 -0
  106. package/dist/mssqlTextStorage.js +9 -0
  107. package/dist/namespace.js +21 -0
  108. package/dist/{wire-B28cPjEp.js → optimisticVersion.js} +2 -2
  109. package/dist/pendingAttribution.js +79 -0
  110. package/dist/pluginRef.js +17 -0
  111. package/dist/predicate.js +266 -0
  112. package/dist/predicateCoercion.js +13 -0
  113. package/dist/projectedColumn.js +37 -0
  114. package/dist/queryBuilder.js +382 -0
  115. package/dist/rawSql.js +8 -0
  116. package/dist/relations.js +69 -0
  117. package/dist/relationsRegistry.js +38 -0
  118. package/dist/replaceInProgress.js +53 -0
  119. package/dist/requiredColumns.js +26 -0
  120. package/dist/residency.js +52 -0
  121. package/dist/retention.js +62 -0
  122. package/dist/rowDecoder.js +123 -0
  123. package/dist/rowKey.js +8 -0
  124. package/dist/rowSchema.js +31 -0
  125. package/dist/scopeKey.js +8 -0
  126. package/dist/seed.js +33 -0
  127. package/dist/snowflake.js +26 -0
  128. package/dist/sql.d.ts +58 -29
  129. package/dist/sql.js +41 -6661
  130. package/dist/sqlCompiler.js +343 -0
  131. package/dist/sqlError.js +8 -0
  132. package/dist/sqlPoolCapacity.js +12 -0
  133. package/dist/sqliteDecimal.js +22 -0
  134. package/dist/sqliteDecimalAggregateSql.js +61 -0
  135. package/dist/sqliteDecimalColumnSql.js +108 -0
  136. package/dist/sqliteDecimalConversion.js +15 -0
  137. package/dist/sqliteDecimalCte.js +154 -0
  138. package/dist/sqliteDecimalEncodeSql.js +32 -0
  139. package/dist/sqliteDecimalOutputs.js +74 -0
  140. package/dist/sqliteDecimalPredicate.js +66 -0
  141. package/dist/sqliteDecimalQuery.js +183 -0
  142. package/dist/sqliteDecimalQueryPlan.js +37 -0
  143. package/dist/sqliteDecimalResultSql.js +44 -0
  144. package/dist/sqliteDecimalRowQuery.js +63 -0
  145. package/dist/sqliteDecimalSetQuery.js +50 -0
  146. package/dist/sqliteDecimalSource.js +63 -0
  147. package/dist/sqliteDecimalStorage.js +29 -0
  148. package/dist/sqliteDecimalSubquery.js +19 -0
  149. package/dist/sqliteDecimalWindowQuery.js +196 -0
  150. package/dist/sqliteValueCoercion.js +4 -0
  151. package/dist/stampId.js +21 -0
  152. package/dist/storeErrors.js +9 -0
  153. package/dist/storeRefusal.js +20 -0
  154. package/dist/stream.js +36 -0
  155. package/dist/subjectGraph.js +175 -0
  156. package/dist/table.js +394 -0
  157. package/dist/tableRegistry.js +16 -0
  158. package/dist/tenantSelection.js +27 -0
  159. package/dist/transactionOutcome.js +97 -0
  160. package/dist/transientContention.js +36 -0
  161. package/dist/typedStore.js +16 -0
  162. package/dist/upsertUpdate.js +20 -0
  163. package/dist/vectorEmbedding.js +31 -0
  164. package/dist/view.js +39 -0
  165. package/dist/wire.d.ts +9 -10
  166. package/dist/wire.js +6 -2
  167. package/dist/writeAttribution.js +16 -0
  168. package/dist/writeRecorder.js +37 -0
  169. package/package.json +4 -6
  170. package/dist/replaceInProgress-DUHl5JEz.js +0 -3557
package/dist/sql.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { ConfigError } from 'effect';
2
- import { Connection } from '@effect/sql/SqlConnection';
1
+ import { Config } from 'effect';
2
+ import { Connection } from 'effect/sql/SqlConnection';
3
3
  import { Effect } from 'effect';
4
- import { Fragment } from '@effect/sql/Statement';
4
+ import { Fragment } from 'effect/sql/Statement';
5
5
  import { Layer } from 'effect';
6
6
  import { Schema } from 'effect';
7
- import { SqlClient } from '@effect/sql';
8
- import { SqlError } from '@effect/sql/SqlError';
9
- import { SqlError as SqlError_2 } from '@effect/sql';
10
- import { Statement } from '@effect/sql';
7
+ import { SqlClient } from 'effect/sql';
8
+ import { SqlError } from 'effect/sql/SqlError';
9
+ import { SqlError as SqlError_2 } from 'effect/sql';
10
+ import { Statement } from 'effect/sql';
11
11
 
12
12
  /** Every hash this source may have been recorded under: its own, and the body
13
13
  * before each framework edit in {@link FRAMEWORK_MIGRATION_EDITS}. */
@@ -359,7 +359,12 @@ export declare interface ApplyPlanCtx {
359
359
  * migration was a framework bug. `voltro db apply` did exactly that for two
360
360
  * releases while `voltro dev`'s boot diff, which uses this parameter, did not.
361
361
  */
362
- readonly replan: (sql: SqlClient.SqlClient) => Effect.Effect<MigrationPlan, SqlError, SqlClient.SqlClient>;
362
+ /** The applier supplies `execution` for every pre-execution replan (including
363
+ * interrupted-run reconciliation), and `convergence` only after planned work.
364
+ * Review-bound callers must validate full content in the execution phase before
365
+ * projecting their transactional/online subsets. Ordinary auto-diff callers
366
+ * can ignore the phase and adapt to the current schema as before. */
367
+ readonly replan: (sql: SqlClient.SqlClient, phase?: 'execution' | 'convergence') => Effect.Effect<MigrationPlan, SqlError, SqlClient.SqlClient>;
363
368
  /**
364
369
  * The declared store charset — the one `replan` plans with. Here only for
365
370
  * the resume ledger this creates before the first statement: nothing declares
@@ -810,7 +815,8 @@ declare interface ColumnDefinition<TsType, Type extends ColumnType = ColumnType,
810
815
  */
811
816
  readonly fkAutoIndex?: boolean;
812
817
  /**
813
- * This id-shaped scalar names something outside the local relational graph.
818
+ * This id-shaped scalar deliberately has no single foreign key target,
819
+ * including external-system ids and local polymorphic targets.
814
820
  * Set by `.externalId()` so schema audits do not guess a local FK from the
815
821
  * column name. Metadata only; it emits no constraint or DDL.
816
822
  */
@@ -1241,7 +1247,8 @@ declare interface ColumnDefinition_2<TsType, Type extends ColumnType_2 = ColumnT
1241
1247
  */
1242
1248
  readonly fkAutoIndex?: boolean;
1243
1249
  /**
1244
- * This id-shaped scalar names something outside the local relational graph.
1250
+ * This id-shaped scalar deliberately has no single foreign key target,
1251
+ * including external-system ids and local polymorphic targets.
1245
1252
  * Set by `.externalId()` so schema audits do not guess a local FK from the
1246
1253
  * column name. Metadata only; it emits no constraint or DDL.
1247
1254
  */
@@ -2576,7 +2583,7 @@ declare type DialectId = 'postgres' | 'mysql' | 'mariadb' | 'mssql' | 'sqlite' |
2576
2583
  * Resolve the live dialect from the `SqlClient`.
2577
2584
  *
2578
2585
  * `sql.onDialectOrElse` collapses the six voltro dialects onto four driver
2579
- * tokens: mysql+mariadb share `mysql` (one `@effect/sql-mysql2` client) and
2586
+ * tokens: mysql+mariadb share `mysql` (one `effect/sql-mysql2` client) and
2580
2587
  * sqlite+turso share `sqlite`. That collapse is fine for every consumer here —
2581
2588
  * the paired dialects behave identically for everything this module decides.
2582
2589
  *
@@ -3143,7 +3150,7 @@ export declare interface FileMigration {
3143
3150
  export declare interface FileMigrationContext {
3144
3151
  /**
3145
3152
  * The escape hatch, and it asks for a reason. `raw('why')` returns the
3146
- * `@effect/sql` client — `sql.unsafe(...)`, `sql\`...\``,
3153
+ * `effect/sql` client — `sql.unsafe(...)`, `sql\`...\``,
3147
3154
  * `sql.onDialectOrElse({...})` — for the one thing neither `store` nor
3148
3155
  * `schema` expresses. The reason is required (an empty one throws), it is
3149
3156
  * what `voltro doctor` lists beside every migration that reaches for raw
@@ -3415,6 +3422,11 @@ export declare interface HeldMigrationLock {
3415
3422
  /** Release the lock and return its connection to the pool. Idempotent only
3416
3423
  * in the sense that the dialect statements are; call it once. */
3417
3424
  readonly release: Effect.Effect<void, SqlError>;
3425
+ /** The reserved connection holding the lock (none on sqlite). Idle between
3426
+ * its keep-alive touches, so work that needs a connection OTHER than its
3427
+ * transaction's — a visibility probe — reads through this one instead of
3428
+ * reserving a third: the migration's contract is two connections. */
3429
+ readonly connection: Connection | undefined;
3418
3430
  }
3419
3431
 
3420
3432
  /**
@@ -3574,11 +3586,17 @@ declare type IndexField = string | {
3574
3586
  declare type IndexKind = 'btree' | 'gist' | 'gin' | 'brin' | 'hnsw';
3575
3587
 
3576
3588
  /**
3577
- * Per-kind tuning options. Today only `hnsw` carries knobs (the pgvector
3578
- * build-time params). `m` controls graph connectivity (default 16),
3589
+ * Per-kind tuning options. GIN supports a single-column operator class;
3590
+ * HNSW supports pgvector build-time parameters. `m` controls graph connectivity (default 16),
3579
3591
  * `efConstruction` the build-time candidate-list size (default 64).
3580
3592
  */
3581
3593
  declare interface IndexKindOptions {
3594
+ /** PostgreSQL GIN operator class for a single plain column.
3595
+ * `gin_trgm_ops` installs pg_trgm and accelerates contains/ILIKE searches.
3596
+ */
3597
+ readonly gin?: {
3598
+ readonly opclass: string;
3599
+ };
3582
3600
  readonly hnsw?: {
3583
3601
  readonly m?: number;
3584
3602
  readonly efConstruction?: number;
@@ -3889,7 +3907,7 @@ export declare type MigrationModuleImporter = (file: string) => Promise<Record<s
3889
3907
  * `log` and the two probes the store can answer about its own shape
3890
3908
  * (`tableExists`, `columnExists`) work without one; each refusal names what to
3891
3909
  * do instead. Also raised at construction when what was handed in as `sql` is not
3892
- * an `@effect/sql` client, or when a SQL-backed store arrives without the
3910
+ * an `effect/sql` client, or when a SQL-backed store arrives without the
3893
3911
  * client it executes on — both are refused before a body can run rather
3894
3912
  * than surfacing as a TypeError from inside the first helper that touches
3895
3913
  * the client.
@@ -4741,7 +4759,7 @@ export declare const previewMigrationSquash: (options: Pick<SquashOptions, "befo
4741
4759
  * Eager provisioning is the APP's move (call this from a seed/startup over its
4742
4760
  * own tenant table); the framework has no tenant registry to enumerate.
4743
4761
  */
4744
- export declare const provisionTenantNamespace: (tables: ReadonlyArray<AnyTable>, namespace: string, sqlLayer: Layer.Layer<SqlClient.SqlClient, ConfigError.ConfigError | SqlError_2.SqlError, never>, dialect?: DialectId, options?: SchemaApplyOptions) => Promise<void>;
4762
+ export declare const provisionTenantNamespace: (tables: ReadonlyArray<AnyTable>, namespace: string, sqlLayer: Layer.Layer<SqlClient.SqlClient, Config.ConfigError | SqlError_2.SqlError, never>, dialect?: DialectId, options?: SchemaApplyOptions) => Promise<void>;
4745
4763
 
4746
4764
  /** Internal offline publication. Receipt and published image share the same
4747
4765
  * commit as table replacement. Retry verifies receipt/schema/retained artifacts
@@ -4773,6 +4791,11 @@ export declare const publishSqliteDecimalStage: (sql: SqlClient.SqlClient, reque
4773
4791
  declare interface QueryDescriptor<R = Row> {
4774
4792
  readonly table: string;
4775
4793
  readonly predicate: Predicate | undefined;
4794
+ /** Additional reactive invalidation sources, independent of SQL row selection.
4795
+ * The runtime merges a query handler's declared `source` tables here. Changes
4796
+ * to these tables recheck subscription authority even when SQL rows do not
4797
+ * change. They add no joins, predicates or cross-tenant access. */
4798
+ readonly dependentTables?: ReadonlyArray<string>;
4776
4799
  /** Phantom — carries the row type through to `store.query()`. Never set at
4777
4800
  * runtime; erased entirely by the compiler. */
4778
4801
  readonly __row?: R;
@@ -5063,6 +5086,11 @@ declare interface QueryDescriptor<R = Row> {
5063
5086
  declare interface QueryDescriptor_2<R = Row_2> {
5064
5087
  readonly table: string;
5065
5088
  readonly predicate: Predicate_2 | undefined;
5089
+ /** Additional reactive invalidation sources, independent of SQL row selection.
5090
+ * The runtime merges a query handler's declared `source` tables here. Changes
5091
+ * to these tables recheck subscription authority even when SQL rows do not
5092
+ * change. They add no joins, predicates or cross-tenant access. */
5093
+ readonly dependentTables?: ReadonlyArray<string>;
5066
5094
  /** Phantom — carries the row type through to `store.query()`. Never set at
5067
5095
  * runtime; erased entirely by the compiler. */
5068
5096
  readonly __row?: R;
@@ -5681,7 +5709,7 @@ declare type Row = Readonly<Record<string, unknown>>;
5681
5709
  declare type Row_2 = Readonly<Record<string, unknown>>;
5682
5710
 
5683
5711
  /** Addresses one row: its `id`, or the columns of an explicit primary key. */
5684
- declare type RowKey = string | Readonly<Record<string, unknown>>;
5712
+ declare type RowKey = string | number | Readonly<Record<string, unknown>>;
5685
5713
 
5686
5714
  /** The context a rule predicate is evaluated with. */
5687
5715
  declare interface RuleContext {
@@ -5776,7 +5804,7 @@ export declare interface RunFileBasedMigrationsCtx {
5776
5804
  * `voltro_isr_cache` so framework releases that grow new columns
5777
5805
  * don't crash old DBs at boot.
5778
5806
  */
5779
- export declare const runFrameworkBootstrap: (tables: ReadonlyArray<AnyTable>, sqlLayer: Layer.Layer<SqlClient.SqlClient, ConfigError.ConfigError | SqlError_2.SqlError, never>, dialect?: DialectId, options?: SchemaApplyOptions) => Promise<void>;
5807
+ export declare const runFrameworkBootstrap: (tables: ReadonlyArray<AnyTable>, sqlLayer: Layer.Layer<SqlClient.SqlClient, Config.ConfigError | SqlError_2.SqlError, never>, dialect?: DialectId, options?: SchemaApplyOptions) => Promise<void>;
5780
5808
 
5781
5809
  /**
5782
5810
  * Run `applySchema` against a fresh SqlClient from the provided sqlLayer.
@@ -5786,7 +5814,7 @@ export declare const runFrameworkBootstrap: (tables: ReadonlyArray<AnyTable>, sq
5786
5814
  * `dialect` is passed through to the DDL emitter so SQL types + reactive
5787
5815
  * trigger emission match the underlying engine.
5788
5816
  */
5789
- export declare const runMigrate: (tables: ReadonlyArray<AnyTable>, sqlLayer: Layer.Layer<SqlClient.SqlClient, ConfigError.ConfigError | SqlError_2.SqlError, never>, dialect?: DialectId, options?: SchemaApplyOptions) => Promise<void>;
5817
+ export declare const runMigrate: (tables: ReadonlyArray<AnyTable>, sqlLayer: Layer.Layer<SqlClient.SqlClient, Config.ConfigError | SqlError_2.SqlError, never>, dialect?: DialectId, options?: SchemaApplyOptions) => Promise<void>;
5790
5818
 
5791
5819
  /**
5792
5820
  * Execute ONE planned operation with the applier's own per-dialect
@@ -6053,6 +6081,8 @@ declare interface SpatialClause_2 {
6053
6081
  readonly order?: 'asc' | 'desc';
6054
6082
  }
6055
6083
 
6084
+ export declare const splitStatements: (sql: string) => ReadonlyArray<string>;
6085
+
6056
6086
  /**
6057
6087
  * The `sql` template tag — captures a tagged-template literal into a
6058
6088
  * {@link RawSqlFragment} descriptor without binding it to any client.
@@ -6360,10 +6390,9 @@ declare interface Table<Name extends string, Fields extends Record<string, Colum
6360
6390
  /**
6361
6391
  * The plugin references DECLARED on this table, surviving `table()`.
6362
6392
  *
6363
- * `pluginRefSpecOf` reads a column BUILDER, and materialisation replaces it
6364
- * with a plain field descriptor — so without this the declaration is
6365
- * unreadable the moment the table exists, and any tool deriving structure
6366
- * from the schema sees an ordinary `text()` column.
6393
+ * Derived from column metadata on every table rebuild, including columns
6394
+ * contributed by mixins. Consumers can inspect these rules without knowing
6395
+ * the private metadata on each materialized scalar definition.
6367
6396
  */
6368
6397
  readonly appliedPluginRefs?: ReadonlyArray<{
6369
6398
  readonly column: string;
@@ -6410,7 +6439,7 @@ declare interface Table<Name extends string, Fields extends Record<string, Colum
6410
6439
  * BEFORE every INSERT. Populated by `.validate(schema)`. Set
6411
6440
  * per-table at table-construction time; immutable thereafter.
6412
6441
  */
6413
- readonly insertSchema?: Schema.Schema.Any;
6442
+ readonly insertSchema?: Schema.Top;
6414
6443
  /**
6415
6444
  * Optional `effect/Schema` the framework decodes a patch against
6416
6445
  * BEFORE every UPDATE. Populated by `.validatePatch(schema)`. The
@@ -6419,7 +6448,7 @@ declare interface Table<Name extends string, Fields extends Record<string, Colum
6419
6448
  * are checked. Set per-table at table-construction time; immutable
6420
6449
  * thereafter.
6421
6450
  */
6422
- readonly validatePatchSchema?: Schema.Schema.Any;
6451
+ readonly validatePatchSchema?: Schema.Top;
6423
6452
  with: <const Mixins extends ReadonlyArray<AnyMixin>>(...mixins: Mixins) => Table<Name, Fields & MergeMixinFields<Mixins>, Reactive, IxNames>;
6424
6453
  /**
6425
6454
  * Attach an effect/Schema that validates EVERY insert against the
@@ -6447,7 +6476,7 @@ declare interface Table<Name extends string, Fields extends Record<string, Colum
6447
6476
  * `id` and `createdAt` are already filled in by the time the
6448
6477
  * decoder sees the row.
6449
6478
  */
6450
- validate: <S extends Schema.Schema.Any>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
6479
+ validate: <S extends Schema.Top>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
6451
6480
  /**
6452
6481
  * Attach an effect/Schema that validates UPDATE patches against the
6453
6482
  * table. The framework wraps the schema in `Schema.partial`, so a
@@ -6478,7 +6507,7 @@ declare interface Table<Name extends string, Fields extends Record<string, Colum
6478
6507
  * wrapping is applied for you, so don't pre-wrap fields in
6479
6508
  * `Schema.optional`.
6480
6509
  */
6481
- validatePatch: <S extends Schema.Schema.Any>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
6510
+ validatePatch: <S extends Schema.Struct<Schema.Struct.Fields>>(schema: S) => Table<Name, Fields, Reactive, IxNames>;
6482
6511
  /**
6483
6512
  * Declare a (possibly composite) secondary index on the table.
6484
6513
  *
@@ -6860,8 +6889,8 @@ declare interface TableIndex {
6860
6889
  */
6861
6890
  readonly kind?: IndexKind;
6862
6891
  /**
6863
- * Per-kind tuning knobs. Today only `hnsw` (`kindOptions.hnsw.{m,
6864
- * efConstruction, opclass}`). Ignored for kinds that don't read it.
6892
+ * Per-kind tuning: `gin.opclass` or `hnsw.{m, efConstruction, opclass}`.
6893
+ * Ignored for kinds that do not read the corresponding options.
6865
6894
  */
6866
6895
  readonly kindOptions?: IndexKindOptions;
6867
6896
  /**