0

I have a simple insert that looks like:

records += Record(c1, c2, c3)

I'd like to change it to make that insert conditional. I don't want to proceed with the insert if a record exists where the all the columns match but c3 is null.

I'd like to have Slick generate the following:

insert into mytable (c1, c2, c3) values ('one', 'two', 'three')
where not exists (select 1 from mytable where c1 = 'one' and c2 = 'two' and c3 is null);
andyczerwonka
  • 4,140
  • 5
  • 34
  • 56
  • 1
    Does this answer your question? [Insert if not exists in Slick 3.0.0](https://stackoverflow.com/questions/30706193/insert-if-not-exists-in-slick-3-0-0) – michaJlS Jun 21 '21 at 07:40

0 Answers0