korma / Korma

Tasty SQL for Clojure.
http://sqlkorma.com
1.48k stars 222 forks source link

Any way to specify ON CONFLICT DO NOTHING? #379

Open vincentjames501 opened 7 years ago

vincentjames501 commented 7 years ago

I'm trying to do inserts with postgres' UPSERT capabilities and it would be nice to be able to add some modifiers after the VALUES in the insert. I don't see a way to easily do this, any advice?

(korma/sql-only
  (korma/insert :table
                (korma/values [{:foo "bar"}])
                (korma/modifier "ON CONFLICT DO NOTHING")))
=> "INSERT INTO \"table\" (\"foo\") VALUES (?)"
dukex commented 7 years ago

Hey @vincentjames501 maybe the issue https://github.com/korma/Korma/issues/112 can help you

venantius commented 6 years ago

I'm going through old issues and trying to clean them up. Has this issue persisted?

If there hasn't been a response to this issue in 2 weeks, I'll close the ticket.