hugsql

stathissideris 2019-12-10T16:55:17.009600Z

hello, I’m a bit unclear about the use of snippets. I was expecting this to work when I call test-sqlvec:

stathissideris 2019-12-10T16:55:21.010Z

-- :snip col
a, b, c, d

-- :name test
-- :result many
select :snip:col from my_table;

stathissideris 2019-12-10T16:56:00.010800Z

I call test-sqlvec without any params and I get:

> (test-sqlvec {})
Execution error (ExceptionInfo) at hugsql.core/validate-parameters! (core.clj:85).
Parameter Mismatch: :col parameter data not found.

stathissideris 2019-12-10T16:57:57.011200Z

hm, by reading the manual more closely it seems that this is not supported

curtis.summers 2019-12-10T17:33:57.013Z

Snippets work a little differently...they are not fragments. Unfortunately, fragments are not implemented yet. Details and some work-arounds here: <https://github.com/layerware/hugsql/issues/36>