Skip to content

Commit

Permalink
fix: table name in column list on export as SQL features, fixes #822
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Jul 4, 2024
1 parent 5b1cd70 commit f7419d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/libs/sqlUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f7419d8

Please sign in to comment.