honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
bertofer 2020-04-15T16:21:07.007600Z

Does anybody has experience with using honeysql to call stored procedures in postgresql with arguments? I always get the error ” Hint: No function matches the given name and argument types. You might need to add explicit type casts.” because the parameters I pass do not match the signature of the function, which tries to do some-fn(record, unknown, unknown)

bertofer 2020-04-16T10:30:10.008Z

Many thanks @matuskmit1! Using cast on the values to pass to the procedure has worked for me 🙂

1👍
nitaai 2020-04-15T17:59:52.007700Z

Generally one would need to do something like (honeysql/call :cast value :uuid) for example to match the PG function’s parameter types. We are using this library https://github.com/DrTom/clj-pg-types in our projects, which does the conversions automatically for the most common cases. One has to require this library somewhere in the project in order for it to work.