-
-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Generate SQL with arrays / support (document?) inline for *format-expr* #403
Comments
I got a reply from Sean with a solution that works.
That was not obvious to me.
and got
|
Given that I think what I will do here is clearly document for the |
It looks like there is a precedent: |
Using |
So not sure what happened, (I believe i updated to latest honeysql),
Otherwise I would get this error:
|
A set is not sequential - it has no defined order. HoneySQL is pretty consistent about requiring sequential values everywhere. |
Thanks, in the case above we are abusing the Array data type in postgres to hold a set. |
After thinking about this on and off for a few months, I've decided that it isn't worth the extra complexity to make |
Originally asked on CLojurians slack https://clojurians-log.clojureverse.org/honeysql/2022-04-01 .
Is there an inline version of
(sql/format-expr [:array (range 5)])
?Or another way to generate an inline SQL for
update my_table set tags = ARRAY['tag1,'tag2'] where ....
?Context:
I'm trying to generate an SQL file for lots of data that I can then bulk import as a transaction.
The file should update a column that is of type PostgreSQL text array
gives me
Which is not the good syntax.
I found a way to handle this but it's not straight forward / documented ?!
=>
The end result I have looks like this:
( I get the first value from format-expr with inline) )
IMO sql/format should allow for a simpler way of supporting
:array
syntaxThe text was updated successfully, but these errors were encountered: