mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 00:46:01 +00:00
fix
This commit is contained in:
@@ -11,7 +11,7 @@ export async function enrichWithPreloadedRows(
|
|||||||
const repl = {};
|
const repl = {};
|
||||||
for (const tableTarget of dbTarget.tables) {
|
for (const tableTarget of dbTarget.tables) {
|
||||||
const tableModel = dbModel.tables.find(x => x.pairingId == tableTarget.pairingId);
|
const tableModel = dbModel.tables.find(x => x.pairingId == tableTarget.pairingId);
|
||||||
if ((tableModel.preloadedRows?.length || 0) == 0) continue;
|
if ((tableModel?.preloadedRows?.length || 0) == 0) continue;
|
||||||
const keyColumns = tableModel.preloadedRowsKey || tableModel.primaryKey?.columns?.map(x => x.columnName);
|
const keyColumns = tableModel.preloadedRowsKey || tableModel.primaryKey?.columns?.map(x => x.columnName);
|
||||||
if ((keyColumns?.length || 0) == 0) continue;
|
if ((keyColumns?.length || 0) == 0) continue;
|
||||||
const dmp = driver.createDumper();
|
const dmp = driver.createDumper();
|
||||||
@@ -24,7 +24,7 @@ export async function enrichWithPreloadedRows(
|
|||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
dmp.put('^select * ^from %f ^where', tableTarget);
|
dmp.put('^select * ^from %f ^where', tableTarget);
|
||||||
dmp.putCollection(' ^or ', tableTarget.preloadedRows, row => {
|
dmp.putCollection(' ^or ', tableModel.preloadedRows, row => {
|
||||||
dmp.put('(');
|
dmp.put('(');
|
||||||
dmp.putCollection(' ^and ', keyColumns, col => dmp.put('%i=%v', col, row[col]));
|
dmp.putCollection(' ^and ', keyColumns, col => dmp.put('%i=%v', col, row[col]));
|
||||||
dmp.put(')');
|
dmp.put(')');
|
||||||
|
|||||||
Reference in New Issue
Block a user