Insert
io.getquill.Insert
Attributes
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
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 rowexcluded
- aliases excluded table, e.g. row proposed for insertion.assign
- left hand side of assignment. Should be accessed fromtable
argumentresult
- 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 proposedcol
in insert. - targets
-
- conflict target
Attributes
In this article