hugsql 2020-10-30

You can work around the HugSQL parser not knowing when to end your parameter and start the SQL by jumping into a Clojure Expression:

select * from /*~ ":sql:prefix" ~*/widgets

👍 1
🙏 1

any ideas on how I can prefix a table name? eg. for tables big_widgets and small_widgets I want to re-use the same queries.sql

SELECT * FROM :sql:prefixwidgets;

was hoping to get that translated to

SELECT * FROM big_widgets;

I tried

SELECT * FROM :sql:prefix\widgets;

but unfortunately the \ is left in the query