(create-table-if-not-exists items
(#(itemid varchar-not-null))
and
(CREATE-TABLE-IF-NOT-EXISTS items
(#(itemid VARCHAR-NOT-NULL))
I've modified it so that symbols with hyphens are split up but not further processed, so they have to be runs of keywords (which is what I intended).
However, there remains a problem I can't do anything about. SQL converts unquoted names to upper case, so CREATE TABLE foo; and CREATE TABLE foo; both create a table named FOO. If you actually want a table actually named foo, you can do it in SQL with CREATE TABLE "foo", because SQL double quotes are like Scheme vertical bars, but my notation doesn't give you any way to make that happen. I thought of having an ad hoc rule like $foo -> "foo", but then what if you want the identifier "$foo"? It's not clear to me whether that's a valid SQL identifier or not.
select "count of" from
(select account_id,count(*) "count of" from orders group by 1)sub where "count of" >20;
That's straightforward: it's |count of| on the Scheme side.
More comments?