clphillips / seedling

A framework agnostic database seeding and fixture library
MIT License
0 stars 0 forks source link

Seedling\Drivers\Standard does not quote reserved words #22

Closed clphillips closed 9 years ago

clphillips commented 9 years ago

Using a field or table name like key in a seed produces an SQL error in MySQL as key is a reserved word.

Seedling\Drivers\Standard should quote field and table names in INSERT queries.

Obviously the quote character varies based on DB (MySQL uses backtick (`) by default, others use double quote ("), MSSQL uses brackets ([])). So the driver would likely need to detect the DB and handle it appropriately.