Skip to content


wrong query building when changed orders of chains #53

tugrul opened this Issue · 1 comment

2 participants

var query = dbConn.query();
query.where('`field3` = ?', [5]);['field1','field2']);

Actual Result:

 FROM `tablename` WHERE field3 = 5SELECT `field1`,`field2`

Targetted Result:

SELECT `field1`,`field2` FROM `tablename` WHERE field3 = 5

I'm seeing this same behavior for joins. If I call join() after having already called where() it wrongly places the join after the where clause. Based on this I presume the code is building the statement as it goes rather than queuing clauses to be built in the proper order later (when calling .sql or .execute)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.