So far I always used these types like (:select (:type my-date-value date)), but explicitly putting 'date' in front of the value string seems to work (I had never seen it before). Only, there is a reason that sql-ize allows one to take the un-escaped version of a value -- when passing arguments to queries with $1-like 'holes' in them, you need to pass them as un-escaped strings, and something like "date '2000-01-01'" produces an error. I've modified sql-escape-string to take an optional second parameter, a prefix, and when sql-ize returns a string as its second value (rather than T or NIL), this now means that the value should be escaped, and that string can be prefixed as type info. This seems to work fine (and has been applied to the repository).
Cheers, Marijn