fix: table name in column list on export as SQL features, fixes #822

This commit is contained in:
Fabio Di Stasio 2024-07-04 18:01:29 +02:00
parent 5b1cd70e25
commit f7419d8e9c
1 changed files with 1 additions and 1 deletions

View File

@ -163,7 +163,7 @@ export const jsonToSqlInsert = (args: {
const sqlInsertAfter = options && options.sqlInsertAfter ? options.sqlInsertAfter : 1;
const sqlInsertDivider = options && options.sqlInsertDivider ? options.sqlInsertDivider : 'rows';
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 insertsString = '';
let queryLength = 0;