mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
fix: table name in column list on export as SQL features, fixes #822
This commit is contained in:
@ -163,7 +163,7 @@ export const jsonToSqlInsert = (args: {
|
|||||||
const sqlInsertAfter = options && options.sqlInsertAfter ? options.sqlInsertAfter : 1;
|
const sqlInsertAfter = options && options.sqlInsertAfter ? options.sqlInsertAfter : 1;
|
||||||
const sqlInsertDivider = options && options.sqlInsertDivider ? options.sqlInsertDivider : 'rows';
|
const sqlInsertDivider = options && options.sqlInsertDivider ? options.sqlInsertDivider : 'rows';
|
||||||
const { elementsWrapper: ew } = customizations[client];
|
const { elementsWrapper: ew } = customizations[client];
|
||||||
const fieldNames = Object.keys(json[0]).map(key => `${ew}${key}${ew}`);
|
const fieldNames = Object.keys(json[0]).map(key => `${ew}${key.split('.').pop()}${ew}`);
|
||||||
let insertStmt = `INSERT INTO ${ew}${table}${ew} (${fieldNames.join(', ')}) VALUES `;
|
let insertStmt = `INSERT INTO ${ew}${table}${ew} (${fieldNames.join(', ')}) VALUES `;
|
||||||
let insertsString = '';
|
let insertsString = '';
|
||||||
let queryLength = 0;
|
let queryLength = 0;
|
||||||
|
Reference in New Issue
Block a user