SqlEntityConflictExtensions Type
Typed conflict handling for an inserted row (OnConflict.DoNothingOn and UpdateOn, with the columns checked by the compiler).
Static members
| Static member |
Description
|
Full Usage:
SqlEntityConflictExtensions.OnConflictDoNothing(row, conflictColumns)
Parameters:
'T
-
The row to insert.
conflictColumns : Expr<('T -> 'Key)>
-
The constraint's or index's columns: a property of the row, or a tuple of them, e.g.
fun r -> r.Code or fun r -> (r.Code, r.Region).
Type parameters: 'T, 'Key (requires :> FSharp.Data.Sql.Common.SqlEntity) |
When the inserted row breaks the unique constraint or index on exactly the given columns, the existing row
stays as it is:
Sets
|
Full Usage:
SqlEntityConflictExtensions.OnConflictUpdate(row, conflictColumns, update)
Parameters:
'T
-
The row to insert.
conflictColumns : Expr<('T -> 'Key)>
-
The constraint's or index's columns: a property of the row, or a tuple of them, e.g.
fun r -> r.Code or fun r -> (r.Code, r.Region).
update : Expr<('T -> 'T -> unit)>
-
Sets properties of the existing row, each to the inserted row's value of the same property or
to a value known before the insert (a constant or a captured value), e.g.
fun existing inserted -> existing.Name <- inserted.Name; existing.Note <- "merged". Properties not
set keep their old values.
Type parameters: 'T, 'Key (requires :> FSharp.Data.Sql.Common.SqlEntity) |
When the inserted row breaks the unique constraint or index on exactly the given columns, the existing row
changes as the update says:
Sets
|