@voltro/data-transfer 0.54.0 → 0.56.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 +639 -2
- package/dist/index.d.ts +51 -10
- package/dist/index.js +496 -468
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -166,6 +166,9 @@ export declare type CanonicalCategory = 'string' | 'integer' | 'float' | 'boolea
|
|
|
166
166
|
* types (a bundle from a newer framework) fall back to 'string' passthrough. */
|
|
167
167
|
export declare const canonicalType: (type: string) => CanonicalCategory;
|
|
168
168
|
|
|
169
|
+
/** Can this store stage at all? */
|
|
170
|
+
export declare const canStage: (store: DataStore) => store is SqlCapableStore;
|
|
171
|
+
|
|
169
172
|
/**
|
|
170
173
|
* Stream every asset the source enumerates into the content-addressed `assetsDir`.
|
|
171
174
|
*
|
|
@@ -491,6 +494,26 @@ export declare type DriftVerdict = 'safe' | 'value-dropped' | 'filled-by-default
|
|
|
491
494
|
* be cleanable by the same call. */
|
|
492
495
|
export declare const dropStagingSql: (table: string, dialect: StagingDialect) => string;
|
|
493
496
|
|
|
497
|
+
/**
|
|
498
|
+
* The tables {@link backupCommand} actually leaves OUT of the artifact, for a
|
|
499
|
+
* given dialect — the list above is what we ASK for, and only two of the five
|
|
500
|
+
* backup paths can honour it.
|
|
501
|
+
*
|
|
502
|
+
* `pg_dump --exclude-table` and `mariadb-dump --ignore-table` drop the named
|
|
503
|
+
* tables from the artifact. The sqlite/turso path is a whole-FILE copy and the
|
|
504
|
+
* mssql path is a `sqlpackage /Action:Export` of the whole database; neither has
|
|
505
|
+
* an exclusion flag, so on those dialects the artifact carries everything.
|
|
506
|
+
*
|
|
507
|
+
* This distinction is not cosmetic bookkeeping — it decides what a faithful
|
|
508
|
+
* restore is allowed to produce. Anything that compares a restored schema
|
|
509
|
+
* against the SOURCE schema (`voltro data restore --drill`) has to subtract
|
|
510
|
+
* exactly this set on the source side, or it reads a deliberate exclusion as a
|
|
511
|
+
* corrupt artifact and fails a healthy backup. Keeping the per-dialect answer
|
|
512
|
+
* here, next to the commands that make it true, is what stops that comparison
|
|
513
|
+
* from re-deriving it and getting it wrong for two dialects out of five.
|
|
514
|
+
*/
|
|
515
|
+
export declare const dumpExcludedTables: (dialect: string) => ReadonlyArray<string>;
|
|
516
|
+
|
|
494
517
|
export declare const emptyLedger: () => Ledger;
|
|
495
518
|
|
|
496
519
|
export declare const encodeManifest: (a: {
|
|
@@ -1581,14 +1604,19 @@ declare const ScopeError_base: Schema.TaggedErrorClass<ScopeError, "ScopeError",
|
|
|
1581
1604
|
/**
|
|
1582
1605
|
* A store that can run raw SQL for us.
|
|
1583
1606
|
*
|
|
1584
|
-
*
|
|
1585
|
-
*
|
|
1586
|
-
*
|
|
1587
|
-
*
|
|
1607
|
+
* `run` is a DECLARED optional capability on `DataStore`, in the shape
|
|
1608
|
+
* `emptyTables` established: the four dialect stores implement it, the in-memory
|
|
1609
|
+
* store and any bare view omit it, and callers feature-detect. It used to be
|
|
1610
|
+
* duck-typed here — a member the interface never mentioned — which meant a store
|
|
1611
|
+
* that dropped it fell out of `canStage()` silently and took the weaker,
|
|
1612
|
+
* transaction-for-the-whole-load path forever, on that one dialect, without a
|
|
1613
|
+
* word. Declaring it is what lets a parity assertion be red about it.
|
|
1614
|
+
*
|
|
1615
|
+
* This type is the NARROWING of that optional member to a store which has it.
|
|
1588
1616
|
*/
|
|
1589
|
-
declare
|
|
1590
|
-
readonly run: <
|
|
1591
|
-
}
|
|
1617
|
+
export declare type SqlCapableStore = DataStore & {
|
|
1618
|
+
readonly run: NonNullable<DataStore['run']>;
|
|
1619
|
+
};
|
|
1592
1620
|
|
|
1593
1621
|
/**
|
|
1594
1622
|
* One table in the swap, and the columns to carry.
|
|
@@ -1613,9 +1641,22 @@ declare interface StagedTable {
|
|
|
1613
1641
|
readonly columns: ReadonlyArray<string>;
|
|
1614
1642
|
}
|
|
1615
1643
|
|
|
1616
|
-
/**
|
|
1617
|
-
*
|
|
1618
|
-
*
|
|
1644
|
+
/**
|
|
1645
|
+
* The prefix a staging table carries.
|
|
1646
|
+
*
|
|
1647
|
+
* RE-EXPORTED, not spelled again. The differ has to know this prefix too — a
|
|
1648
|
+
* staging clone is REGISTERED for the length of the load, and a registered table
|
|
1649
|
+
* is a declared one, so without the exclusion a plan computed mid-import
|
|
1650
|
+
* proposes `create-table _voltro_staging_notes` — and `@voltro/database` cannot
|
|
1651
|
+
* import this package. So the string lives there (`isStagingTableName`) and this
|
|
1652
|
+
* is the same value under the name the import path already used. Two copies of a
|
|
1653
|
+
* prefix that two packages must agree on is exactly the drift this repo keeps
|
|
1654
|
+
* paying for.
|
|
1655
|
+
*
|
|
1656
|
+
* `_voltro_`-prefixed so the boot differ's framework-table rule also refuses to
|
|
1657
|
+
* plan a live one as a lossy DROP — an import on another replica may be loading
|
|
1658
|
+
* into it right now.
|
|
1659
|
+
*/
|
|
1619
1660
|
export declare const STAGING_PREFIX = "_voltro_staging_";
|
|
1620
1661
|
|
|
1621
1662
|
/** Whether this run stages, and — always — WHY NOT when it does not. */
|