senecajs-labs / seneca-standard-query

MIT License
2 stars 5 forks source link

"when" column breaks the store #9

Open mihaidma opened 8 years ago

mihaidma commented 8 years ago

"when" column breaks the store, needs to check if an escape is missing https://github.com/senecajs/seneca-user/issues/51

wzrdtales commented 8 years ago

Same as https://github.com/senecajs/seneca-mysql-store/issues/57

wzrdtales commented 8 years ago

The correct escape char should be defined on the driver level and passed to this module afterwards. E.g. mysql needs to use ` instead of " or '.

mihaidma commented 7 years ago

@wzrdtales please see this code: https://github.com/senecajs-labs/seneca-standard-query/blob/master/standard-query.js#L23

in what case is your query escaped with " or ' ?

wzrdtales commented 7 years ago

@mihaidma This is actually database dependend. You need to look for evey database you support.

See for example MySQL http://dev.mysql.com/doc/refman/5.7/en/identifiers.html where backticks are needed to escape schema objects.

wzrdtales commented 7 years ago

And this given, the escape char must be defined on the driver not on this library. Otherwise this library can get useless for some new driver that has other needs which it can't pass along.