This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-25
Channels
- # announcements (16)
- # babashka (110)
- # babashka-sci-dev (11)
- # beginners (50)
- # biff (3)
- # calva (1)
- # clj-commons (19)
- # clj-kondo (1)
- # clojure (17)
- # clojure-art (19)
- # clojure-austin (5)
- # clojure-berlin (2)
- # clojure-denmark (3)
- # clojure-europe (101)
- # clojurescript (84)
- # clr (1)
- # core-async (2)
- # emacs (3)
- # helix (5)
- # honeysql (4)
- # hyperfiddle (8)
- # introduce-yourself (2)
- # jobs (1)
- # lsp (18)
- # membrane (3)
- # reagent (5)
- # releases (3)
- # shadow-cljs (10)
- # tools-deps (24)
Lots of https://www.postgresql.org/docs/current/functions-string.html#FUNCTIONS-STRING-SQL need to have things like a FROM b
in their arguments, e.g. substring(scope FROM 5 FOR 7)
.
Do I understand it correctly that a proper way to do it is to register a custom function?
Yes, register-fn!
will let you add special syntax. This sounds worth being added to core -- can you create an issue with a link to the relevant PG docs and I'll take a look?
For anyone interested in trying out the potential solution to this, develop has been updated with :*foo
style keywords in function arguments being treated as a interspersed SQL keywords -- see these tests for examples: https://github.com/seancorfield/honeysql/blob/develop/test/honey/sql_test.cljc#L1112-L1132 -- the syntax is still open to debate but the machinery seems reasonable.
Yes, register-fn!
will let you add special syntax. This sounds worth being added to core -- can you create an issue with a link to the relevant PG docs and I'll take a look?
For anyone interested in trying out the potential solution to this, develop has been updated with :*foo
style keywords in function arguments being treated as a interspersed SQL keywords -- see these tests for examples: https://github.com/seancorfield/honeysql/blob/develop/test/honey/sql_test.cljc#L1112-L1132 -- the syntax is still open to debate but the machinery seems reasonable.