ibdknox/Korma — Issue #15: h2 and quoting of table and column names
Author: nshah
Created: 2011-11-12 23:20:59+00:00
State: open

It looks like korma doesn't quote table and column names. When using h2 with lobos for example, the create statements look like this in the h2 trace log:

/*SQL t:3*/CREATE TABLE \"image\" (\"id\" INTEGER AUTO_INCREMENT, \"original\" INTEGER, \"src\" VARCHAR(255),
\"alt\" VARCHAR(512), \"width\" SMALLINT, \"height\" SMALLINT,
CONSTRAINT \"image_primary_key_id\" PRIMARY KEY (\"id\"));

But korma's selects against the same table look like:

SELECT * FROM image WHERE (image.id = ?) [42102-161]

Which turns out are not the same thing. Korma would need to do something like this instead to reference the same objects:

SELECT * FROM "image" WHERE ("image"."id" = 1)