Fork me on GitHub
#honeysql
<
2021-03-28
>
aratare12:03:46

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?

dharrigan14:03:15

Seek and ye shall find

dharrigan14:03:06

(mind you, that is v2 of honeysql)

aratare14:03:05

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

dharrigan15:03:23

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

👍 3