Skip to content

Commit

Permalink
Convert produced statements to objects before querying (#4323)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickrum committed Feb 27, 2021
1 parent 9e28a72 commit 5ec76f5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/execution/runner.js
Expand Up @@ -223,11 +223,17 @@ class Runner {
if (!query.statementsProducer) {
return this.query(query);
}

const statements = await query.statementsProducer(
undefined,
this.connection
);
return this.queryArray(statements);
const queryObjects = statements.map((statement) => ({
sql: statement,
bindings: query.bindings,
}));

return this.queryArray(queryObjects);
}

const results = [];
Expand Down

0 comments on commit 5ec76f5

Please sign in to comment.