honeysql

Discussion of https://github.com/seancorfield/honeysql :slightly_smiling_face:
aratare 2021-03-28T12:06:46.072500Z

Hi there. I’m trying to delete a row in a POSTGRESQL table with

(-> (helpers/delete-from :current-user)
                            (helpers/where [:= :user/id id] [:= :user/token token])
                            (sql/format :quoting :ansi))
but it seems that the default behaviour when used with next.jdbc/execute-one! is to return {:update count 1}. Is there a way for me to return the deleted row instead?

dharrigan 2021-03-28T14:08:15.073Z

Seek and ye shall find <https://github.com/seancorfield/honeysql/blob/24b87ebd69e756d910d38bece954f3e1d2de864d/test/honey/sql/postgres_test.cljc#L141>

dharrigan 2021-03-28T14:10:06.073200Z

(mind you, that is v2 of honeysql)

aratare 2021-03-28T14:22:05.073600Z

Thanks. I may upgrade to v2 if it’s stable enough.

dharrigan 2021-03-28T15:16:23.074200Z

I've been using it for a while (in admittingly non-production, but near to production) code. Works just like v1 πŸ™‚

1πŸ‘