kylefarris / node-querybuilder

Node QueryBuilder Adapter for Node.js (tags: nodejs, node, mysql, active record, activerecord, querybuilder, query builder)
49 stars 19 forks source link

After delete query, select does not work #26

Closed TheEzraMiller closed 6 years ago

TheEzraMiller commented 6 years ago

screenshot 2018-06-11 14 04 12

db table is empty just has the "column_1" (works the same if table has contents)

response from the first url is normal screenshot 2018-06-11 14 05 36

but from the second after delete, app fails (records get deleted, just the select afterwards fails)

screenshot 2018-06-11 14 05 10
kylefarris commented 6 years ago

Apparently I didn't have any tests to check for that scenario. I've been using this library for years in production and haven't experienced this issue--it may only happen after a delete. I'm investigating now. Fix should be out soon.

kylefarris commented 6 years ago

This is a particularly peculiar bug. It does seems to only be happening after delete statements and I'm still trying to figure out exactly what's happening to cause it. It does seem to have something to do with a reference that's not being handled properly.

kylefarris commented 6 years ago

I think this is going to take some bigger fixing at a fundamental level. I'm working on a new version which is going to sorta re-write the code a little bit. The API should stay basically the same, though. There's definitely some kind of reference errors that I can't track down and it may be due to the way the code is written.

So, expect a patch in version 3.

kylefarris commented 6 years ago

This is officially fixed in the v2 branch. Beta should be out soon.