@voltro/database 0.69.1 → 0.71.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/dist/sql.d.ts CHANGED
@@ -873,6 +873,17 @@ export declare interface ColumnSnapshot {
873
873
  readonly referenceStorage?: 'text' | 'numeric';
874
874
  /** `oneOf(['a','b'])` → CHECK constraint values. */
875
875
  readonly oneOf?: ReadonlyArray<string>;
876
+ /** Required/observed JSON validity on SQL Server. Unverified means no
877
+ * recognized enabled and trusted check proves the existing data valid. */
878
+ readonly jsonValidation?: 'value' | 'container' | 'unverified';
879
+ /** Live SQL Server JSON checks recognized by complete predicate shape.
880
+ * Names are catalog identities for DDL, not portable schema fingerprints. */
881
+ readonly jsonChecks?: ReadonlyArray<{
882
+ readonly name: string;
883
+ readonly validation: 'value' | 'container';
884
+ readonly enabled: boolean;
885
+ readonly trusted: boolean;
886
+ }>;
876
887
  /**
877
888
  * Fixed-point precision + scale for a `decimal(p,s)` / `numeric(p,s)`
878
889
  * column (`type === 'decimal'`). Drives the emitted `NUMERIC(p,s)` /
@@ -1140,10 +1151,22 @@ export declare const emitAddIndexMysql: (op: Extract<MigrationOperation, {
1140
1151
  kind: "add-index";
1141
1152
  }>, declared: ReadonlyArray<TableLike>, engine?: MysqlEngine) => string;
1142
1153
 
1154
+ export declare const emitCreateTableMssql: (op: Extract<MigrationOperation, {
1155
+ kind: "create-table";
1156
+ }>) => ReadonlyArray<string>;
1157
+
1143
1158
  export declare const emitCreateTableMysql: (op: Extract<MigrationOperation, {
1144
1159
  kind: "create-table";
1145
1160
  }>, engine?: MysqlEngine) => ReadonlyArray<string>;
1146
1161
 
1162
+ export declare const emitCreateTablePg: (op: Extract<MigrationOperation, {
1163
+ kind: "create-table";
1164
+ }>) => ReadonlyArray<string>;
1165
+
1166
+ export declare const emitCreateTableSqlite: (op: Extract<MigrationOperation, {
1167
+ kind: "create-table";
1168
+ }>) => ReadonlyArray<string>;
1169
+
1147
1170
  export declare const emitDropColumnDdl: (op: Extract<MigrationOperation, {
1148
1171
  kind: "drop-column";
1149
1172
  }>, q: typeof quote,
@@ -1497,14 +1520,14 @@ declare interface IndexKindOptions {
1497
1520
  * - `'inner'` → `vector_ip_ops` (negative inner product)
1498
1521
  * The opclass MUST match the metric the query orders by, or the
1499
1522
  * index can't accelerate the search. Set `opclass` directly only to
1500
- * override the mapping (e.g. `halfvec_cosine_ops`).
1523
+ * override the mapping. Half-precision columns select `halfvec_*` automatically.
1501
1524
  */
1502
1525
  readonly distance?: VectorDistance;
1503
1526
  /**
1504
1527
  * pgvector opclass token spliced into `USING hnsw (col <opclass>)`.
1505
- * When unset, derived from `distance` (default `vector_cosine_ops`).
1506
- * Set explicitly to override (e.g. `'halfvec_cosine_ops'` for a
1507
- * `vector(n, { precision: 'half' })` column).
1528
+ * When unset, derived from `distance` and the column's precision
1529
+ * (default `vector_cosine_ops`, or `halfvec_cosine_ops` for half precision).
1530
+ * An explicit override is an unquoted, optionally schema-qualified identifier.
1508
1531
  */
1509
1532
  readonly opclass?: string;
1510
1533
  };
@@ -1515,6 +1538,10 @@ export declare interface IndexSnapshot {
1515
1538
  readonly table: string;
1516
1539
  readonly columns: ReadonlyArray<string>;
1517
1540
  readonly unique: boolean;
1541
+ /** Physical access method; absent means btree. Catalogs may name extension methods. */
1542
+ readonly kind?: string;
1543
+ /** Resolved HNSW build parameters and operator class, not a query-time metric. */
1544
+ readonly kindOptions?: IndexKindOptions;
1518
1545
  /** SQL predicate for a partial/filtered index; never a full UNIQUE constraint. */
1519
1546
  readonly where?: string;
1520
1547
  /** False for an invalid PostgreSQL index left by an interrupted online build. */
@@ -1746,6 +1773,13 @@ export declare type MigrationOperation = {
1746
1773
  readonly kind: 'drop-check';
1747
1774
  readonly table: string;
1748
1775
  readonly column: string;
1776
+ } | {
1777
+ readonly kind: 'reconcile-json-check';
1778
+ readonly table: string;
1779
+ readonly column: string;
1780
+ readonly validation: 'value' | 'container';
1781
+ readonly previousValidation: 'value' | 'container' | 'unverified' | 'absent';
1782
+ readonly dropConstraints: ReadonlyArray<string>;
1749
1783
  };
1750
1784
 
1751
1785
  export declare interface MigrationPlan {
@@ -1962,7 +1996,7 @@ export declare type OperationClass =
1962
1996
  * cleanly through JSON (the `operations` column of `_voltro_migrations`)
1963
1997
  * and can be grepped in `voltro logs` output.
1964
1998
  */
1965
- export declare type OperationKind = 'create-table' | 'drop-table' | 'add-column' | 'drop-column' | 'rename-column' | 'alter-column-nullability' | 'alter-column-type' | 'alter-column-default' | 'add-index' | 'drop-index' | 'add-unique' | 'drop-unique' | 'add-unique-composite' | 'drop-unique-composite' | 'add-foreign-key' | 'drop-foreign-key' | 'add-check' | 'drop-check';
1999
+ export declare type OperationKind = 'create-table' | 'drop-table' | 'add-column' | 'drop-column' | 'rename-column' | 'alter-column-nullability' | 'alter-column-type' | 'alter-column-default' | 'add-index' | 'drop-index' | 'add-unique' | 'drop-unique' | 'add-unique-composite' | 'drop-unique-composite' | 'add-foreign-key' | 'drop-foreign-key' | 'add-check' | 'drop-check' | 'reconcile-json-check';
1966
2000
 
1967
2001
  declare interface OrderClause {
1968
2002
  readonly column: string;
@@ -2600,9 +2634,9 @@ export declare const rehearsedOperation: (planned: PlannedOperation) => Rehearse
2600
2634
  */
2601
2635
  export declare const rehearseMigrationOnBranch: (ops: BranchRehearsalOps) => Promise<BranchRehearsalReport>;
2602
2636
 
2603
- export declare const renderColumnMysql: (col: ColumnSnapshot) => string;
2637
+ export declare const renderColumnMysql: (col: ColumnSnapshot, hasCompositePk?: boolean) => string;
2604
2638
 
2605
- export declare const renderColumnPg: (col: ColumnSnapshot) => string;
2639
+ export declare const renderColumnPg: (col: ColumnSnapshot, hasCompositePk?: boolean) => string;
2606
2640
 
2607
2641
  /**
2608
2642
  * The effective lock schema: an explicit scope wins; otherwise `DB_SCHEMA`