Where in the Slick 3 documentation is it documented on how to do an insertOrUpdate
-like operation?
The insertOrUpdate method that comes with slick 3.x is limited to MySQL Only. You won't get any warnings/code documentation, it will just throw Integrity exceptions.
In order to upsert with Slick if using Postgres, you can use slick-pg.
This support is there in Slick . Look at this merge : Pull Request Merged Here The support was added in Slick 2.1 .
These are also called upsert
statements.
However i would think you would want to use plain SQL(for the native DB you are using) for this kind of requirement. Look here for examples of how to use Slick to do this.
Basically code that looks like the following ,
val reviews = TableQuery[<Class extending Table>]
val upsert: DBIO[Int] = reviews.insertOrUpdate(<value to be inserted>)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With