It is safer to use lower case table names and field names with MySQL
The generated DDL uses double quotes instead of back ticks. MySQL does not like double quotes unless it is started with the --ansi option.
The generated DDL does not specify a length for VARCHAR so the DDL is rejected. Other options for generating similar code exist for MySQL. Here is what is generated:
create table SUPPLIERS (
SUP_ID INTEGER NOT NULL PRIMARY KEY,
SUP_NAME VARCHAR NOT NULL,
STREET VARCHAR NOT NULL,
CITY VARCHAR NOT NULL,
STATE VARCHAR NOT NULL,
ZIP VARCHAR NOT NULL)
... and this is what works:
use slickexamples;
create table SUPPLIERS (
SUP_ID INTEGER NOT NULL PRIMARY KEY,
SUP_NAME VARCHAR(255) NOT NULL,
STREET VARCHAR(255) NOT NULL,
CITY VARCHAR(255) NOT NULL,
STATE VARCHAR(255) NOT NULL,
ZIP VARCHAR(255) NOT NULL)
I also found that the automatic lifting to a Query blows up with MySQL:
You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near
'VARCHAR))||' ')||cast(x2."PRICE" as VARCHAR))||' ')||cast(x2."SALES" as VARCHAR)' at line 1
I forked the slick-examples project to use MySQL (https://github.com/mslinn/slick-examples) and found problems with the generated SQL.
... and this is what works:
I also found that the automatic lifting to a Query blows up with MySQL:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARCHAR))||' ')||cast(x2."PRICE" as VARCHAR))||' ')||cast(x2."SALES" as VARCHAR)' at line 1