@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.
- package/CHANGELOG.md +1215 -0
- package/THIRD-PARTY-NOTICES.md +5 -89
- package/dist/actorSnapshot.js +24 -0
- package/dist/arrayCodec.js +32 -0
- package/dist/branchExecute.js +92 -0
- package/dist/branching.js +106 -0
- package/dist/bulkInsertLimits.js +25 -0
- package/dist/cdcOffsetsTables.js +19 -0
- package/dist/changeEvent.js +41 -0
- package/dist/changeIdentity.js +65 -0
- package/dist/changeListenerCeiling.js +6 -0
- package/dist/columnReference.js +17 -0
- package/dist/columns.js +326 -0
- package/dist/committedChanges.js +12 -0
- package/dist/connectionIdentity.js +36 -0
- package/dist/coreTables.js +16 -0
- package/dist/coreTablesRegistry.js +10 -0
- package/dist/dataTransfers.js +22 -0
- package/dist/dbCause.js +222 -0
- package/dist/dbMetrics.js +65 -0
- package/dist/decimalComparison.js +27 -0
- package/dist/derivedRowId.js +5 -0
- package/dist/dialect.js +13 -0
- package/dist/enumRenames.js +14 -0
- package/dist/expiresMixin.js +10 -0
- package/dist/fieldEncryption.js +98 -0
- package/dist/frameworkTables.js +130 -0
- package/dist/ginIndex.js +10 -0
- package/dist/hybridSearch.js +32 -0
- package/dist/idGenerator.js +57 -0
- package/dist/identifierLimits.js +32 -0
- package/dist/index.d.ts +122 -64
- package/dist/index.js +81 -2080
- package/dist/indexAudit.js +61 -0
- package/dist/indexStorage.js +58 -0
- package/dist/joinCompiler.js +160 -0
- package/dist/jsonEagerCompiler.js +436 -0
- package/dist/jsonPatch.js +78 -0
- package/dist/jsonPatchAssignments.js +13 -0
- package/dist/jsonPath.js +31 -0
- package/dist/localFirstMixin.js +12 -0
- package/dist/migrate.js +624 -0
- package/dist/migration.js +18 -0
- package/dist/migrations/appliedAtValue.js +8 -0
- package/dist/migrations/applier.js +1085 -0
- package/dist/migrations/boot.js +196 -0
- package/dist/migrations/branchRehearsal.js +122 -0
- package/dist/migrations/columnEquivalence.js +85 -0
- package/dist/migrations/ddlError.js +63 -0
- package/dist/migrations/declaredSchema.js +162 -0
- package/dist/migrations/deployLedger.js +19 -0
- package/dist/migrations/fileBased.js +57 -0
- package/dist/migrations/fileContext.js +482 -0
- package/dist/migrations/fileDiscovery.js +318 -0
- package/dist/migrations/fileSkipProbes.js +117 -0
- package/dist/migrations/fingerprint.js +46 -0
- package/dist/migrations/fkCycles.js +13 -0
- package/dist/migrations/frameworkLiveTables.js +25 -0
- package/dist/migrations/idempotentDdl.js +37 -0
- package/dist/migrations/indexPredicate.js +50 -0
- package/dist/migrations/introspect.js +799 -0
- package/dist/migrations/ledgerRows.js +4 -0
- package/dist/migrations/lock.js +91 -0
- package/dist/migrations/migrationTableExists.js +9 -0
- package/dist/migrations/mssqlColumnDependencies.js +76 -0
- package/dist/migrations/mysqlEngine.js +11 -0
- package/dist/migrations/namespaceCharset.js +51 -0
- package/dist/migrations/planner.js +775 -0
- package/dist/migrations/postgresEnumCheck.js +19 -0
- package/dist/migrations/reactiveTriggerDrift.js +58 -0
- package/dist/migrations/reactiveTriggerName.js +7 -0
- package/dist/migrations/renameMssqlCheck.js +21 -0
- package/dist/migrations/restoreSnapshots.js +206 -0
- package/dist/migrations/resumeLedger.js +86 -0
- package/dist/migrations/rollingDeploy.js +106 -0
- package/dist/migrations/schemaOwner.js +46 -0
- package/dist/migrations/schemaOwnerTable.js +4 -0
- package/dist/migrations/softDropSnapshot.js +20 -0
- package/dist/migrations/sqlLimit.js +8 -0
- package/dist/migrations/sqliteConstraintIdentity.js +97 -0
- package/dist/migrations/sqliteDecimalBoot.js +22 -0
- package/dist/migrations/sqliteDecimalPublication.js +257 -0
- package/dist/migrations/sqliteDecimalReview.js +30 -0
- package/dist/migrations/sqliteDecimalReviewStore.js +188 -0
- package/dist/migrations/sqliteDecimalReviewWitness.js +38 -0
- package/dist/migrations/sqliteDecimalSource.js +69 -0
- package/dist/migrations/sqliteDecimalStage.js +135 -0
- package/dist/migrations/sqliteForeignKeys.js +38 -0
- package/dist/migrations/sqliteMigrationBatch.js +37 -0
- package/dist/migrations/sqliteRetainedSource.js +106 -0
- package/dist/migrations/sqliteRowIdentity.js +63 -0
- package/dist/migrations/sqliteSchemaEpoch.js +12 -0
- package/dist/migrations/sqliteSnapshotGuard.js +10 -0
- package/dist/migrations/sqliteTableContents.js +34 -0
- package/dist/migrations/sqliteTableCopy.js +25 -0
- package/dist/migrations/sqliteTableSchema.js +19 -0
- package/dist/migrations/sqliteWitnessProtection.js +8 -0
- package/dist/migrations/squash.js +81 -0
- package/dist/migrations/storeCharset.js +66 -0
- package/dist/migrations/transactionCause.js +10 -0
- package/dist/migrations/undeclaredCharset.js +40 -0
- package/dist/migrations/uniqueActiveLowering.js +39 -0
- package/dist/mixins.js +22 -0
- package/dist/mssqlDecimalDistinct.js +51 -0
- package/dist/mssqlJsonValueCheck.js +42 -0
- package/dist/mssqlTextStorage.js +9 -0
- package/dist/namespace.js +21 -0
- package/dist/{wire-B28cPjEp.js → optimisticVersion.js} +2 -2
- package/dist/pendingAttribution.js +79 -0
- package/dist/pluginRef.js +17 -0
- package/dist/predicate.js +266 -0
- package/dist/predicateCoercion.js +13 -0
- package/dist/projectedColumn.js +37 -0
- package/dist/queryBuilder.js +382 -0
- package/dist/rawSql.js +8 -0
- package/dist/relations.js +69 -0
- package/dist/relationsRegistry.js +38 -0
- package/dist/replaceInProgress.js +53 -0
- package/dist/requiredColumns.js +26 -0
- package/dist/residency.js +52 -0
- package/dist/retention.js +62 -0
- package/dist/rowDecoder.js +123 -0
- package/dist/rowKey.js +8 -0
- package/dist/rowSchema.js +31 -0
- package/dist/scopeKey.js +8 -0
- package/dist/seed.js +33 -0
- package/dist/snowflake.js +26 -0
- package/dist/sql.d.ts +58 -29
- package/dist/sql.js +41 -6661
- package/dist/sqlCompiler.js +343 -0
- package/dist/sqlError.js +8 -0
- package/dist/sqlPoolCapacity.js +12 -0
- package/dist/sqliteDecimal.js +22 -0
- package/dist/sqliteDecimalAggregateSql.js +61 -0
- package/dist/sqliteDecimalColumnSql.js +108 -0
- package/dist/sqliteDecimalConversion.js +15 -0
- package/dist/sqliteDecimalCte.js +154 -0
- package/dist/sqliteDecimalEncodeSql.js +32 -0
- package/dist/sqliteDecimalOutputs.js +74 -0
- package/dist/sqliteDecimalPredicate.js +66 -0
- package/dist/sqliteDecimalQuery.js +183 -0
- package/dist/sqliteDecimalQueryPlan.js +37 -0
- package/dist/sqliteDecimalResultSql.js +44 -0
- package/dist/sqliteDecimalRowQuery.js +63 -0
- package/dist/sqliteDecimalSetQuery.js +50 -0
- package/dist/sqliteDecimalSource.js +63 -0
- package/dist/sqliteDecimalStorage.js +29 -0
- package/dist/sqliteDecimalSubquery.js +19 -0
- package/dist/sqliteDecimalWindowQuery.js +196 -0
- package/dist/sqliteValueCoercion.js +4 -0
- package/dist/stampId.js +21 -0
- package/dist/storeErrors.js +9 -0
- package/dist/storeRefusal.js +20 -0
- package/dist/stream.js +36 -0
- package/dist/subjectGraph.js +175 -0
- package/dist/table.js +394 -0
- package/dist/tableRegistry.js +16 -0
- package/dist/tenantSelection.js +27 -0
- package/dist/transactionOutcome.js +97 -0
- package/dist/transientContention.js +36 -0
- package/dist/typedStore.js +16 -0
- package/dist/upsertUpdate.js +20 -0
- package/dist/vectorEmbedding.js +31 -0
- package/dist/view.js +39 -0
- package/dist/wire.d.ts +9 -10
- package/dist/wire.js +6 -2
- package/dist/writeAttribution.js +16 -0
- package/dist/writeRecorder.js +37 -0
- package/package.json +4 -6
- package/dist/replaceInProgress-DUHl5JEz.js +0 -3557
package/dist/sql.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Connection } from '
|
|
1
|
+
import { Config } from 'effect';
|
|
2
|
+
import { Connection } from 'effect/sql/SqlConnection';
|
|
3
3
|
import { Effect } from 'effect';
|
|
4
|
-
import { Fragment } from '
|
|
4
|
+
import { Fragment } from 'effect/sql/Statement';
|
|
5
5
|
import { Layer } from 'effect';
|
|
6
6
|
import { Schema } from 'effect';
|
|
7
|
-
import { SqlClient } from '
|
|
8
|
-
import { SqlError } from '
|
|
9
|
-
import { SqlError as SqlError_2 } from '
|
|
10
|
-
import { Statement } from '
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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.
|
|
3578
|
-
* build-time
|
|
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
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
-
*
|
|
6364
|
-
*
|
|
6365
|
-
*
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
6864
|
-
*
|
|
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
|
/**
|