Skip to content

Commit

Permalink
put data in response object
Browse files Browse the repository at this point in the history
  • Loading branch information
Megapixel99 committed Jan 17, 2024
1 parent c8ba5ba commit d67e604
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/dialects/sqlanywhere/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ class Client_Sqlanywhere extends Client {
if (!obj.sql) throw new Error('The query is empty');

return new Promise((resolve, reject) => {
let cb = (err, result) => {
let cb = (err, response) => {
if (err) return reject(err);
resolve(result);
obj.response = response;
resolve(obj);
};
if (obj.bindings) {
return connection.exec(obj.sql, obj.bindings, cb);
Expand Down

1 comment on commit d67e604

@Megapixel99
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Knex passes a custom object between methods and the query function (the function that is being modified) needs to save the output of the query to that object so it can be used later on, such as on this line.

Please sign in to comment.