hugsql

roklenarcic 2018-10-23T13:59:05.000100Z

hey there. I've been using raw SQL parameters such as :sql:param and when I try to use them to eliminate clauses I get SQL is empty message

roklenarcic 2018-10-23T13:59:27.000100Z

here's an example:

CREATE SEQUENCE IF NOT EXISTS :i:name
--~ (if (:min-value params) "MINVALUE :sql:min-value" "")
--~ (if (:max-value params) "MAXVALUE :sql:max-value" "")
--~ (if (:value params) "START WITH :sql:value" "")
--~ (if (:inc params) "INCREMENT BY :sql:inc" "")
CYCLE

roklenarcic 2018-10-23T13:59:56.000100Z

this doesn't work, because it complains about expressions resulting in empty strings

roklenarcic 2018-10-23T14:00:36.000100Z

is there some other way to have "if x = true then include clause else skip" functionality that's not too verbose