Insert

io.getquill.Insert
sealed trait Insert[E] extends QAC[E, Nothing], Action[E]

Attributes

Graph
Supertypes
trait Action[E]
trait QAC[E, Nothing]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def onConflictIgnore(target: E => Any, targets: E => Any*): Insert[E]
def onConflictUpdate(assign: (E, E) => (Any, Any), assigns: (E, E) => (Any, Any)*): Insert[E]
def onConflictUpdate(target: E => Any, targets: E => Any*)(assign: (E, E) => (Any, Any), assigns: (E, E) => (Any, Any)*): Insert[E]

Generates an atomic INSERT or UPDATE (upsert) action if supported.

Generates an atomic INSERT or UPDATE (upsert) action if supported.

Value parameters

assigns

- update statement, declared as function: (table, excluded) => (assign, result) table - is used to extract column for update assignment and reference existing row excluded - aliases excluded table, e.g. row proposed for insertion. assign - left hand side of assignment. Should be accessed from table argument result - right hand side of assignment. Example usage:

 insert.onConflictUpdate(_.id)((t, e) => t.col -> (e.col + t.col))

If insert statement violates conflict target then the column col of row will be updated with sum of existing value and proposed col in insert.

targets

- conflict target

Attributes

def returning[R](f: E => R): ActionReturning[E, R]
def returningGenerated[R](f: E => R): ActionReturning[E, R]
def returningMany[R](f: E => R): ActionReturning[E, List[R]]