Fork me on GitHub
#sql
<
2018-05-24
>
tristefigure09:05:36

I'm not sur it really answers what you're looking for bu postgres has a RETURNING clause. https://www.postgresql.org/docs/9.5/static/dml-returning.html I think it can be used with a subselect: ... RETURNING (SELECT ...).

jahson19:05:32

Is there any way to use mysql’s on duplicate key update id = last_insert_id(id) in jdbc/insert!?

jahson19:05:51

And the second question is about how to use now() in jdbc/insert! — is it possible?

seancorfield19:05:58

@jahson use execute! for more complex insert operations. You can pass :return-keys true as an option to get back the generated keys (if your DB supports it).

seancorfield19:05:18

(assuming you're on the latest clojure.java.jdbc version)