HugSQL SQL files contain special single-line comments and multi-line comments in the following forms:
-- :key value1 value2 value3
-- regular SQL comment ignored by hugsql
regular SQL multi-line comment ignored by hugsql
-- :name query-get-many :? :*
-- :doc My query doc string to end of this line
select * from my_table;
-- :name query-get-one :? :1
comment doc string
select * from my_table limit 1
HugSQL recognizes the following keys:
:name-(private fn) Name of the function to create. Optionally followed by the command and result (e.g.,
:name :? :*) instead of providing these as separate key/value pairs.
:docDocstring for the created function.
:commandUnderlying database command to run.
:resultExpected result type (shape).
:snip-(private fn) Name of the function to create.
:snipis used in place of
:metaMetadata in the form of an EDN hashmap to attach to function.
:requireNamespace require and aliases for Clojure expression support.