@hasna/cloud 0.1.10 → 0.1.11
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/cli/index.js +14 -1
- package/dist/index.js +14 -1
- package/dist/mcp/index.js +14 -1
- package/dist/sync.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -11490,7 +11490,20 @@ async function syncTransfer(source, target, options, _direction) {
|
|
|
11490
11490
|
continue;
|
|
11491
11491
|
}
|
|
11492
11492
|
const pkColumns = await resolvePrimaryKeys(source, target, table, pkOption);
|
|
11493
|
-
const
|
|
11493
|
+
const sourceColumns = Object.keys(rows[0]);
|
|
11494
|
+
let targetColumns = null;
|
|
11495
|
+
if (!isAsyncAdapter(target)) {
|
|
11496
|
+
try {
|
|
11497
|
+
const colInfo = target.all(`PRAGMA table_info("${table}")`);
|
|
11498
|
+
targetColumns = new Set(colInfo.map((c) => c.name));
|
|
11499
|
+
} catch {}
|
|
11500
|
+
} else {
|
|
11501
|
+
try {
|
|
11502
|
+
const colInfo = await target.all(`SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = '${table}'`);
|
|
11503
|
+
targetColumns = new Set(colInfo.map((c) => c.column_name));
|
|
11504
|
+
} catch {}
|
|
11505
|
+
}
|
|
11506
|
+
const columns = targetColumns ? sourceColumns.filter((c) => targetColumns.has(c)) : sourceColumns;
|
|
11494
11507
|
if (pkColumns.length === 0) {
|
|
11495
11508
|
result.errors.push(`Table "${table}" has no primary key — inserting without conflict handling`);
|
|
11496
11509
|
onProgress?.({
|
package/dist/index.js
CHANGED
|
@@ -9482,7 +9482,20 @@ async function syncTransfer(source, target, options, _direction) {
|
|
|
9482
9482
|
continue;
|
|
9483
9483
|
}
|
|
9484
9484
|
const pkColumns = await resolvePrimaryKeys(source, target, table, pkOption);
|
|
9485
|
-
const
|
|
9485
|
+
const sourceColumns = Object.keys(rows[0]);
|
|
9486
|
+
let targetColumns = null;
|
|
9487
|
+
if (!isAsyncAdapter(target)) {
|
|
9488
|
+
try {
|
|
9489
|
+
const colInfo = target.all(`PRAGMA table_info("${table}")`);
|
|
9490
|
+
targetColumns = new Set(colInfo.map((c) => c.name));
|
|
9491
|
+
} catch {}
|
|
9492
|
+
} else {
|
|
9493
|
+
try {
|
|
9494
|
+
const colInfo = await target.all(`SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = '${table}'`);
|
|
9495
|
+
targetColumns = new Set(colInfo.map((c) => c.column_name));
|
|
9496
|
+
} catch {}
|
|
9497
|
+
}
|
|
9498
|
+
const columns = targetColumns ? sourceColumns.filter((c) => targetColumns.has(c)) : sourceColumns;
|
|
9486
9499
|
if (pkColumns.length === 0) {
|
|
9487
9500
|
result.errors.push(`Table "${table}" has no primary key — inserting without conflict handling`);
|
|
9488
9501
|
onProgress?.({
|
package/dist/mcp/index.js
CHANGED
|
@@ -24829,7 +24829,20 @@ async function syncTransfer(source, target, options, _direction) {
|
|
|
24829
24829
|
continue;
|
|
24830
24830
|
}
|
|
24831
24831
|
const pkColumns = await resolvePrimaryKeys(source, target, table, pkOption);
|
|
24832
|
-
const
|
|
24832
|
+
const sourceColumns = Object.keys(rows[0]);
|
|
24833
|
+
let targetColumns = null;
|
|
24834
|
+
if (!isAsyncAdapter(target)) {
|
|
24835
|
+
try {
|
|
24836
|
+
const colInfo = target.all(`PRAGMA table_info("${table}")`);
|
|
24837
|
+
targetColumns = new Set(colInfo.map((c) => c.name));
|
|
24838
|
+
} catch {}
|
|
24839
|
+
} else {
|
|
24840
|
+
try {
|
|
24841
|
+
const colInfo = await target.all(`SELECT column_name FROM information_schema.columns WHERE table_schema = 'public' AND table_name = '${table}'`);
|
|
24842
|
+
targetColumns = new Set(colInfo.map((c) => c.column_name));
|
|
24843
|
+
} catch {}
|
|
24844
|
+
}
|
|
24845
|
+
const columns = targetColumns ? sourceColumns.filter((c) => targetColumns.has(c)) : sourceColumns;
|
|
24833
24846
|
if (pkColumns.length === 0) {
|
|
24834
24847
|
result.errors.push(`Table "${table}" has no primary key — inserting without conflict handling`);
|
|
24835
24848
|
onProgress?.({
|
package/dist/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../src/sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAMnD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,YAAY,KAAK,IAAI,CAAC;AAEpE,MAAM,WAAW,WAAW;IAC1B,sBAAsB;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kCAAkC;IAClC,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAMD;;;GAGG;AACH,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,WAAW,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