@zintrust/d1-migrator 1.9.0 → 1.9.2
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/README.md
CHANGED
|
@@ -143,12 +143,14 @@ zin migrate-to-d1 \
|
|
|
143
143
|
zin migrate-to-d1 \
|
|
144
144
|
--from postgresql \
|
|
145
145
|
--source-connection "postgresql://user:password@localhost:5432/sourcedb" \
|
|
146
|
-
--
|
|
146
|
+
--remote \
|
|
147
147
|
--target-database my-d1-remote \
|
|
148
148
|
--batch-size 5000 \
|
|
149
149
|
--checkpoint-interval 25000
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
+
Use `--remote` to execute against the resolved Wrangler D1 binding with `wrangler d1 ... --remote`. If the target entry in `wrangler.jsonc` has `"remote": true`, `zin migrate-to-d1` also defaults to remote execution automatically for that binding.
|
|
153
|
+
|
|
152
154
|
#### Dry Run (Test Mode)
|
|
153
155
|
|
|
154
156
|
```bash
|
|
@@ -196,6 +198,7 @@ zin migrate-to-d1 \
|
|
|
196
198
|
| ----------------------- | ----- | ------- | -------- | ------- | ------------------------------------------------------------------ |
|
|
197
199
|
| `--from` | `-f` | string | ✗ | — | Source database type: `mysql`, `postgresql`, `sqlite`, `sqlserver` |
|
|
198
200
|
| `--to` | `-t` | string | ✗ | `d1` | Target: `d1` (local) or `d1-remote` |
|
|
201
|
+
| `--remote` | — | boolean | ✗ | `false` | Execute target D1 statements through Wrangler remote mode |
|
|
199
202
|
| `--source-connection` | `-s` | string | ✗ | — | Source connection URI (falls back to env or DB\_\* composition) |
|
|
200
203
|
| `--target-database` | `-d` | string | ✗ | `d1` | Target D1 database identifier (or env fallback) |
|
|
201
204
|
| `--batch-size` | `-b` | number | ✗ | `1000` | Records per batch during data copy |
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataMigrator.d.ts","sourceRoot":"","sources":["../../src/cli/DataMigrator.ts"],"names":[],"mappings":"AACA;;;GAGG;AAWH,O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iB,WAClB,OAAO,CAAC,iBAAiB,CAAC,GAClC,iBAAiB;EAGpB,CAAC"}
|
package/dist/cli/DataMigrator.js
CHANGED
|
@@ -3,13 +3,121 @@
|
|
|
3
3
|
* Data Migrator
|
|
4
4
|
* Handles the actual data migration between databases
|
|
5
5
|
*/
|
|
6
|
-
import { ErrorFactory, LocalD1Resolver, Logger } from '@zintrust/core';
|
|
6
|
+
import { ErrorFactory, LocalD1Resolver, Logger, WranglerD1 } from '@zintrust/core';
|
|
7
7
|
import { MySQLAdapter } from '@zintrust/db-mysql';
|
|
8
8
|
import { PostgreSQLAdapter } from '@zintrust/db-postgres';
|
|
9
9
|
import { SQLiteAdapter } from '@zintrust/db-sqlite';
|
|
10
10
|
import { SQLServerAdapter } from '@zintrust/db-sqlserver';
|
|
11
11
|
import { SchemaBuilder } from '../schema/SchemaBuilder.js';
|
|
12
12
|
import { SchemaAnalyzer } from './SchemaAnalyzer.js';
|
|
13
|
+
const extractWranglerJson = (output) => {
|
|
14
|
+
const trimmed = output.trim();
|
|
15
|
+
if (!trimmed.startsWith('[')) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
return JSON.parse(trimmed);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const parseWranglerTable = (output) => {
|
|
26
|
+
const lines = output.split('\n').map((line) => line.trim());
|
|
27
|
+
const dataLines = lines.filter((line) => line.startsWith('│') && line.endsWith('│'));
|
|
28
|
+
if (dataLines.length < 2) {
|
|
29
|
+
return [];
|
|
30
|
+
}
|
|
31
|
+
const parseCells = (line) => {
|
|
32
|
+
return line
|
|
33
|
+
.slice(1, -1)
|
|
34
|
+
.split('│')
|
|
35
|
+
.map((cell) => cell.trim());
|
|
36
|
+
};
|
|
37
|
+
const headers = parseCells(dataLines[0]);
|
|
38
|
+
const rows = [];
|
|
39
|
+
for (const line of dataLines.slice(1)) {
|
|
40
|
+
const cells = parseCells(line);
|
|
41
|
+
if (cells.length !== headers.length) {
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
const row = {};
|
|
45
|
+
headers.forEach((header, index) => {
|
|
46
|
+
row[header] = cells[index] ?? '';
|
|
47
|
+
});
|
|
48
|
+
rows.push(row);
|
|
49
|
+
}
|
|
50
|
+
return rows;
|
|
51
|
+
};
|
|
52
|
+
const toHex = (value) => {
|
|
53
|
+
return Array.from(value)
|
|
54
|
+
.map((byte) => byte.toString(16).padStart(2, '0'))
|
|
55
|
+
.join('');
|
|
56
|
+
};
|
|
57
|
+
const toSqlLiteral = (value) => {
|
|
58
|
+
if (value === null || value === undefined) {
|
|
59
|
+
return 'NULL';
|
|
60
|
+
}
|
|
61
|
+
if (value instanceof Date) {
|
|
62
|
+
return `'${value.toISOString().replace(/'/g, "''")}'`;
|
|
63
|
+
}
|
|
64
|
+
if (typeof value === 'string') {
|
|
65
|
+
return `'${value.replace(/'/g, "''")}'`;
|
|
66
|
+
}
|
|
67
|
+
if (typeof value === 'number') {
|
|
68
|
+
if (!Number.isFinite(value)) {
|
|
69
|
+
throw ErrorFactory.createValidationError('Cannot serialize non-finite number for remote D1');
|
|
70
|
+
}
|
|
71
|
+
return String(value);
|
|
72
|
+
}
|
|
73
|
+
if (typeof value === 'bigint') {
|
|
74
|
+
return value.toString();
|
|
75
|
+
}
|
|
76
|
+
if (typeof value === 'boolean') {
|
|
77
|
+
return value ? '1' : '0';
|
|
78
|
+
}
|
|
79
|
+
const globalBuffer = globalThis;
|
|
80
|
+
if (globalBuffer.Buffer?.isBuffer(value) === true || value instanceof Uint8Array) {
|
|
81
|
+
const bytes = value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
82
|
+
return `X'${toHex(bytes)}'`;
|
|
83
|
+
}
|
|
84
|
+
return `'${JSON.stringify(value).replace(/'/g, "''")}'`;
|
|
85
|
+
};
|
|
86
|
+
const bindSqlParameters = (sql, parameters) => {
|
|
87
|
+
let index = 0;
|
|
88
|
+
return sql.replace(/\?/g, () => {
|
|
89
|
+
if (index >= parameters.length) {
|
|
90
|
+
throw ErrorFactory.createValidationError('Remote D1 SQL parameter count mismatch');
|
|
91
|
+
}
|
|
92
|
+
const rendered = toSqlLiteral(parameters[index]);
|
|
93
|
+
index += 1;
|
|
94
|
+
return rendered;
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
const createRemoteD1Adapter = (database) => {
|
|
98
|
+
return {
|
|
99
|
+
async connect() {
|
|
100
|
+
await Promise.resolve();
|
|
101
|
+
},
|
|
102
|
+
async disconnect() {
|
|
103
|
+
await Promise.resolve();
|
|
104
|
+
},
|
|
105
|
+
async query(sql, parameters) {
|
|
106
|
+
const renderedSql = bindSqlParameters(sql, parameters);
|
|
107
|
+
const output = WranglerD1.executeSql({ dbName: database, isLocal: false, sql: renderedSql });
|
|
108
|
+
const payload = extractWranglerJson(output);
|
|
109
|
+
if (payload === null || payload.length === 0) {
|
|
110
|
+
const rows = parseWranglerTable(output).map((row) => row);
|
|
111
|
+
return { rows, rowCount: rows.length };
|
|
112
|
+
}
|
|
113
|
+
const last = payload[payload.length - 1];
|
|
114
|
+
const rows = Array.isArray(last.results) ? last.results : [];
|
|
115
|
+
const changes = last.meta?.changes;
|
|
116
|
+
const rowCount = typeof changes === 'number' ? changes : rows.length;
|
|
117
|
+
return { rows, rowCount };
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
};
|
|
13
121
|
const redactConnectionString = (connectionString) => {
|
|
14
122
|
try {
|
|
15
123
|
const parsed = new URL(connectionString);
|
|
@@ -315,6 +423,11 @@ export const DataMigrator = Object.freeze({
|
|
|
315
423
|
throw ErrorFactory.createConnectionError(`Unable to connect resolved local D1 path ${d1LocalPath}: ${String(error)}`);
|
|
316
424
|
}
|
|
317
425
|
}
|
|
426
|
+
else {
|
|
427
|
+
Logger.info(`[DataMigrator] Using Wrangler remote D1 target: ${config.targetDatabase}`);
|
|
428
|
+
connection.adapter = createRemoteD1Adapter(config.targetDatabase);
|
|
429
|
+
await connection.adapter.connect();
|
|
430
|
+
}
|
|
318
431
|
Logger.info('✓ Target D1 database connected');
|
|
319
432
|
return connection;
|
|
320
433
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MigrateToD1Command.d.ts","sourceRoot":"","sources":["../../src/cli/MigrateToD1Command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC,OAAO,KAAK,EAAE,eAAe,EAA0B,MAAM,UAAU,CAAC;AAOxE,KAAK,iBAAiB,GAAG;IACvB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,IAAI,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,KAAK,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC/B,CAAC;
|
|
1
|
+
{"version":3,"file":"MigrateToD1Command.d.ts","sourceRoot":"","sources":["../../src/cli/MigrateToD1Command.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAe,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CA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
|
|
|
461
461
|
throw ErrorFactory.createValidationError('Source connection is required. Use --source-connection or set MIGRATE_TO_D1_SOURCE_CONNECTION (or DB_* variables)');
|
|
462
462
|
};
|
|
463
463
|
const resolveTargetType = (options) => {
|
|
464
|
+
if (readOptionFlag(options, ['remote'])) {
|
|
465
|
+
return 'd1-remote';
|
|
466
|
+
}
|
|
464
467
|
const fromOption = readOptionString(options, ['to']);
|
|
465
468
|
const fromEnv = readEnvString(TARGET_TYPE_ENV_KEYS);
|
|
466
469
|
const configuredValue = fromOption ?? fromEnv;
|
|
@@ -468,7 +471,19 @@ const resolveTargetType = (options) => {
|
|
|
468
471
|
if (configuredValue !== undefined && targetType === undefined) {
|
|
469
472
|
throw ErrorFactory.createValidationError(`Unsupported target type: ${configuredValue}. Expected d1 or d1-remote`);
|
|
470
473
|
}
|
|
471
|
-
|
|
474
|
+
if (targetType !== undefined) {
|
|
475
|
+
return targetType;
|
|
476
|
+
}
|
|
477
|
+
try {
|
|
478
|
+
const resolvedTarget = WranglerConfig.getD1Database(process.cwd(), resolveTargetDatabase(options));
|
|
479
|
+
if (resolvedTarget?.remote === true) {
|
|
480
|
+
return 'd1-remote';
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
catch {
|
|
484
|
+
// Fall back to local default when target resolution is unavailable here.
|
|
485
|
+
}
|
|
486
|
+
return 'd1';
|
|
472
487
|
};
|
|
473
488
|
const resolveSourceSsl = (options) => {
|
|
474
489
|
if (readOptionFlag(options, ['source-ssl', 'sourceSsl'])) {
|
|
@@ -548,6 +563,7 @@ export const MigrateToD1Command = BaseCommand.create({
|
|
|
548
563
|
command
|
|
549
564
|
.option('-f, --from <type>', 'Source database type (mysql, postgresql, sqlite, sqlserver)')
|
|
550
565
|
.option('-t, --to <type>', 'Target D1 type (d1, d1-remote)')
|
|
566
|
+
.option('--remote', 'Use Wrangler remote D1 execution for the resolved target binding')
|
|
551
567
|
.option('-s, --source-connection <string>', 'Source database connection string')
|
|
552
568
|
.option('--source-ssl', 'Force SSL/TLS for source database connection')
|
|
553
569
|
.option('-d, --target-database <string>', 'Target D1 database name')
|
|
@@ -579,6 +595,7 @@ export const MigrateToD1Command = BaseCommand.create({
|
|
|
579
595
|
driver: config.sourceDriver,
|
|
580
596
|
connectionString: config.sourceConnection,
|
|
581
597
|
sourceConnectionOrigin: config.sourceConnectionOrigin,
|
|
598
|
+
sourceSsl: config.sourceSsl === true,
|
|
582
599
|
};
|
|
583
600
|
// Analyze source schema
|
|
584
601
|
Logger.info('Analyzing source database schema...');
|