Hi honeybees, I've got a question that's probably been asked a dozen times, but here goes: I'm trying to get a PostgreSQL query returning all columns following an insert, and I think I've followed all directions and it's still not bearing fruit. When I try this (with nilenso's PG extension):
(-> (insert-into :blahs)
(values [{:blah 1}])
(psqlh/returning :*)
sql/format)
I get:
["INSERT INTO blahs (blah) VALUES (?) " 1]
Though I'd expect:
["INSERT INTO blahs (blah) VALUES (?) RETURNING *" 1]
I'm using:
[nilenso/honeysql-postgres "0.2.6"]
[honeysql "0.9.5"]
Can anyone point me in the right direction or have I caught a booboo?I would guess that you haven't required honeysql-postgres.format
anywhere, it contains the formatter multimethod implementations. This is not very clear from the documentation.
🏆 We have a winner! Thank you Sami, I definitely wouldn't have caught that. Now I can stop appending the string " RETURNING *"
and feeling dirty... about that, at least.