@voltro/data-transfer 0.80.0 → 0.82.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.
@@ -10789,7 +10789,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
10789
10789
  SOFTWARE.
10790
10790
  ```
10791
10791
 
10792
- ## undici@8.10.0
10792
+ ## undici@8.11.2
10793
10793
 
10794
10794
  License: MIT
10795
10795
 
package/dist/index.d.ts CHANGED
@@ -1218,6 +1218,49 @@ export declare interface MaskInput {
1218
1218
  /** Apply a resolved plan to one row. */
1219
1219
  export declare const maskRow: (row: Row, table: string, actions: Readonly<Record<string, MaskAction>>, seed: string, columnTypes?: Readonly<Record<string, string>>) => Row;
1220
1220
 
1221
+ /**
1222
+ * The statements around the import, each one batch, all run on `master`.
1223
+ * `carry` runs after the import: the target's own rows of each environment-local
1224
+ * table replace whatever the artefact brought, matched by column name so an
1225
+ * older artefact with fewer columns still takes them. `swap` puts the copy in
1226
+ * place and drops the replaced database; `undoSwap` puts the old one back if the
1227
+ * swap stops half-way.
1228
+ */
1229
+ export declare const mssqlReplaceStatements: (step: Pick<MssqlReplaceStep, "live" | "scratch" | "carry">) => {
1230
+ prepare: string[];
1231
+ carry: string[];
1232
+ swap: string[];
1233
+ undoSwap: string[];
1234
+ cleanup: string[];
1235
+ };
1236
+
1237
+ /**
1238
+ * The mssql restore. `sqlpackage /Action:Import` accepts only a new or EMPTY
1239
+ * database (SQL71659), so it cannot load over the live one the way `pg_restore
1240
+ * --clean` does. It imports into a scratch database beside it, carries the
1241
+ * TARGET's environment-local rows into that copy (what `EXCLUDED_FROM_DUMP`
1242
+ * achieves on the other dialects: the marker and the transfer history describe
1243
+ * this database, not the source's), then swaps the names. The live database is
1244
+ * untouched until the swap, so a failed import leaves it exactly as it was.
1245
+ */
1246
+ export declare interface MssqlReplaceStep {
1247
+ readonly kind: 'mssql-replace';
1248
+ readonly load: Extract<NativeStep, {
1249
+ kind: 'spawn';
1250
+ }>;
1251
+ /** The server, as a connection to `master` — where the swap runs. */
1252
+ readonly server: NativeConn;
1253
+ readonly live: string;
1254
+ readonly scratch: string;
1255
+ readonly carry: ReadonlyArray<string>;
1256
+ }
1257
+
1258
+ /** The database an mssql restore imports into before the swap. UNIQUE per run:
1259
+ * after the swap the live database keeps the scratch name's data FILES, so a
1260
+ * fixed name collides with them on the next restore (`Msg 5170 … already
1261
+ * exists`). Leftovers of a killed run share the prefix and are dropped first. */
1262
+ export declare const mssqlScratchName: (live: string, run?: string) => string;
1263
+
1221
1264
  export declare interface NativeConn {
1222
1265
  /** Full connection URL (preferred for postgres — the tool consumes it
1223
1266
  * directly). Parsed to flags for mysql. */
@@ -1231,6 +1274,10 @@ export declare interface NativeConn {
1231
1274
  readonly filename?: string;
1232
1275
  }
1233
1276
 
1277
+ /** Runs statements for a step that needs SQL rather than a vendor tool. The
1278
+ * caller owns the driver; this package does not. */
1279
+ export declare type NativeSql = (conn: NativeConn, statements: ReadonlyArray<string>) => Effect.Effect<void, unknown>;
1280
+
1234
1281
  /** One executable step: spawn a tool (optionally piping a file to stdin, or its
1235
1282
  * stdout to a file), or a pure file copy (sqlite). */
1236
1283
  export declare type NativeStep = {
@@ -1247,7 +1294,7 @@ export declare type NativeStep = {
1247
1294
  readonly kind: 'copy';
1248
1295
  readonly from: string;
1249
1296
  readonly to: string;
1250
- };
1297
+ } | MssqlReplaceStep;
1251
1298
 
1252
1299
  /** A native backup/restore tool failed — missing binary, non-zero exit, or an
1253
1300
  * unsupported dialect. `stderr` carries the tool's own diagnostics. INTERNAL —
@@ -1565,9 +1612,10 @@ export declare const runExport: (opts: ExportOptions) => Effect.Effect<Manifest,
1565
1612
 
1566
1613
  export declare const runImport: (opts: ImportOptions) => Effect.Effect<ImportOutcome, ImportError>;
1567
1614
 
1568
- /** Execute a {@link NativeStep} — spawn the tool (wiring stdin/stdout files) or
1569
- * copy the file. Maps a missing binary / non-zero exit to {@link NativeToolError}. */
1570
- export declare const runNativeStep: (step: NativeStep) => Effect.Effect<void, NativeToolError>;
1615
+ /** Execute a {@link NativeStep} — spawn the tool (wiring stdin/stdout files),
1616
+ * copy the file, or run the mssql import-and-swap through `sql`. Maps a missing
1617
+ * binary / non-zero exit to {@link NativeToolError}. */
1618
+ export declare const runNativeStep: (step: NativeStep, sql?: NativeSql) => Effect.Effect<void, NativeToolError>;
1571
1619
 
1572
1620
  /**
1573
1621
  * Default rows per savepoint. 200 puts the happy-path overhead at one percent