Inconsistent double quote escaping
Created by: Sharkwald
When using CamelCased DB object names, there are a number of instances where the SQL generated is not double quote escaped, causing errors to be thrown.
For example, using Chinook:
db > db.Artist.findOne(1, function(err, result) { console.log(err); });
undefined
db > { [error: relation "artist" does not exist]
Places where I've found this issue so far are the table name, the columns and the default order by (i.e. the pk).
I'm not sure whether to include the custom order by, since it's a supplied string, so the delimiting could be placed in the calling code. On the one hand that feels like a potential gotcha, on the other hand, the whole point is to take advantage of postgres' sql engine, which means playing by its rules.
I think I should have a fix for this ready for a PR soon, but I want to ensure it's properly tested first.
PS: This is the first time I've raised an issue & worked on the fix, so please be gentle!