MssqlUpsert class
SQL Server upsert without MERGE.
The first update covers the common path. If no row exists, the guarded insert takes a serializable key-range lock for the duration of that statement. If another writer wins the race, the final update applies this upsert's values to the row it created. A unique index over matching is still required: it defines what "the same row" means to the database.
- Available extensions
- Annotations
-
- @immutable
Constructors
-
MssqlUpsert.into(String identifier, {required Map<
String, Object?> matching, required Map<String, Object?> insertValues, required Map<String, Object?> updateValues}) -
factory
-
MssqlUpsert.intoParts(List<
String> parts, {required Map<String, Object?> matching, required Map<String, Object?> insertValues, required Map<String, Object?> updateValues}) -
The parts-based form; see MssqlSource.parts.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
insertValues
→ Map<
String, Object?> -
final
-
matching
→ Map<
String, Object?> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → MssqlSource
-
final
-
updateValues
→ Map<
String, Object?> -
final
Methods
-
compile(
{MssqlDialect dialect = MssqlDialect.sql2012}) → MssqlStatement -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
run(
MssqlSession session, {MssqlDialect dialect = MssqlDialect.sql2012, Duration? timeout}) → Future< int> -
Available on MssqlUpsert, provided by the MssqlUpsertExecution extension
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited