When you call clsql:locally-enable-sql-reader-syntax, that lets you put
brackets around sql field names. Will this work with the QUOTE
operator? And by extension, BACKQUOTE?
Is there anything to keep in mind to make this work correctly?
"Jonathon McKitrick" <···········@bigfoot.com> wrote in
····························@e56g2000cwe.googlegroups.com:
> When you call clsql:locally-enable-sql-reader-syntax, that lets you put
> brackets around sql field names. Will this work with the QUOTE
> operator? And by extension, BACKQUOTE?
> Is there anything to keep in mind to make this work correctly?
>
It seems you can do this:
(defmacro foo (table)
`(print-query [select [*] :from ,table]))
(foo [customer])
or this
(defmacro foo (table)
`(print-query [select [*] :from ,(sql-expression :table table)]))
(foo customer)
but this doesn't seem possible
(defmacro foo (table)
`(print-query [select [*] :from [,table]]))
(foo customer)
The reason seems to be that whatever is in [...]
gets expanded into a (sql-expression) before the macro expansion.