vrana/notorm

fails to quote column/table identifiers

Closed this issue · 4 comments

A generated query: SELECT * FROM scrl_context WHERE (key = 'default');
Fails because "key" is a reserved word and must be quoted: key

(quoted with backticks)

Ugh. PDO still has no quoteIdentifier(), so fixing this requires sniffing out the DB type from PDO.

This is a documented behavior. You can quote the column name by yourself but the best approach is to avoid keywords in your identifiers.

This does not work:

$table()->where('"select".name = ?', $name);