Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in batch_update | Cannot read property 'reset_query' of undefined #63

Open
niranjan02 opened this issue Aug 13, 2020 · 1 comment

Comments

@niranjan02
Copy link

niranjan02 commented Aug 13, 2020

I was using batch_update but facing this error. The query I am getting in next_batch is working fine still I am getting this.

batch_data
[
{ column1: 'test', coolumn2: '2.0.2444', id: 12 },
{ column1: 'test', coolumn2: '2.0.24444', id: 13 }
]

qb.update_batch(table_name, batch_data, key, where_object, (err, res) => {
if (err) {
reject(err);
}
resolve(res);
});

TypeError: Cannot read property 'reset_query' of undefined
    at next_batch (C:\Project\node_modules\node-querybuilder\drivers\mysql\query_exec.js:178:22)
    at handler (C:\Project\node_modules\node-querybuilder\drivers\mysql\query_exec.js:205:15)
    at new Promise (<anonymous>)
    at Single.update_batch (C:\Project\node_modules\node-querybuilder\drivers\mysql\query_exec.js:209:20)
    at C:\Project\dao\mysql_helper.js:125:8
    at C:\Project\node_modules\node-querybuilder\drivers\mysql\adapters\pool.js:54:65
    at DatastoreShim.applySegment (C:\Project\node_modules\newrelic\lib\shim\shim.js:1430:20)
    at wrapper (C:\Project\node_modules\newrelic\lib\shim\shim.js:2092:17)
    at Ping.onOperationComplete (C:\Project\node_modules\mysql\lib\Pool.js:110:5)0|communications_micro_service_index  |     at Ping.<anonymous> (C:\managecommunicationsmicroservice\node_modules\mysql\lib\Connection.js:526:10)

@niranjan02 niranjan02 changed the title error in batch_update error in batch_update | Cannot read property 'reset_query' of undefined Aug 13, 2020
@jijojayaprakash
Copy link

jijojayaprakash commented Jun 29, 2022

Inside handler function this object scope is not available. In node_modules\node-querybuilder\drivers\mysql\query_exec.js change the lines as per the below image.
unknown (3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants