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

Already on GitHub? Sign in to your account

delete chained method fails #64

shelleyp opened this Issue Apr 4, 2012 · 1 comment


None yet
2 participants

shelleyp commented Apr 4, 2012

The delete chained method fails. The following:

var sql = qry.delete('nodetest2')
.where('id = ?', [4])

Generates the following SQL, which is in error:

DELETE nodetest2 WHERE id = ?

To elaborate, the correct MySQL syntax for deleting from a single table is

DELETE FROM `table_name` WHERE row = value

Whereas the code currently only seems to produce

DELETE `table_name` WHERE row = value

when delete('table_name') is used. The relevant lines in the test that needs to be modified is 605 and 610 - a FROM needs to be added after the DELETE. I think the change could be as simple as editing L381 from query.cc to include the FROM, but I'm not familiar enough with the code to make the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment