Closed ryantm closed 8 years ago
okay, I figured out I needed to use defineTableFromDB' which lets me pass in the mysql config that turns off normalizing the table names. https://github.com/khibino/haskell-relational-record/blob/e6bb2bcada551bee956cf526233f3768e8e62920/relational-schemas/src/Database/Relational/Schema/MySQLInfo/Config.hs
I recommend adding that to the mysql example. https://github.com/khibino/haskell-relational-record/blob/master/examples/HDBC/MySQL/src/Example/DataSource.hs
I have a lowercase-named database in MySQL and when I use defineTable
The generated SQL statements include references to the table name like
DBNAME.tablename
, which does not work because MySQL defaults to case sensitive on Unix systems:http://dev.mysql.com/doc/refman/5.7/en/identifier-case-sensitivity.html
I believe this links to the line that is the problem:
https://github.com/khibino/haskell-relational-record/blob/e6bb2bcada551bee956cf526233f3768e8e62920/relational-query/src/Database/Relational/Query/TH.hs#L268