How to safely use reserved SQL names?

As already mentioned by Vishal Gajjar in the comments, you are using the reserved keyword desc for your column name, hence the error, it’s not bakes fault, it’s yours.

In order to be able to use such reserved words, the column name needs to be quoted properly, however CakePHP 3 doesn’t auto-quote by default anymore, as it’s an expensive operation.

If you insist on using reserved words, enable identifier quoting via the quoteIdentifiers option in your app.php config, or enable it manually using the autoQuoting() (enableAutoQuoting() as of CakePHP 3.4) method of the DB driver.

See also

Leave a Comment