Inserting (and NOT upserting) using scalikejdbc

334 Views Asked by At

I do not see a way to execute my sql insert statement without using scalikejdbc's update or execute functions, both of which turn my insert into an upsert.

  sql"""INSERT INTO scopes (id, name, status, level) VALUES ($id, $name, $status, $level)""".update.apply()

I expect the scope to be inserted only if a scope with the same ID does not exist in the DB. Otherwise I expect it to throw an error.

In reality, if the scope already exists, this code updates it.

0

There are 0 best solutions below