Skip to content

Commit

Permalink
fix: issue with postgres insert and paired item (#4020)
Browse files Browse the repository at this point in the history
fix: issue with postgres node and paired item
  • Loading branch information
krynble authored Sep 5, 2022
1 parent 6be9997 commit 9314086
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export async function pgQueryV2(
if (mode === 'multiple') {
return (await db.multi(pgp.helpers.concat(allQueries)))
.map((result, i) => {
return this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray([...result]), {
return this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(result), {
itemData: { item: i },
});
})
Expand Down Expand Up @@ -374,9 +374,9 @@ export async function pgInsertV2(
if (mode === 'multiple') {
const query =
pgp.helpers.insert(getItemsCopy(items, columnNames, guardedColumns), cs) + returning;
return (await db.any(query))
.map((result, i) => {
return this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray([...result]), {
const queryResult = await db.any(query);
return queryResult.map((result, i) => {
return this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(result), {
itemData: { item: i },
});
})
Expand Down

0 comments on commit 9314086

Please sign in to comment.