mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-29 04:24:21 +00:00
Let the user choose between the two possible update strategies for upsert
This commit is contained in:
1 parent
7f9d1503a0
commit
7b01c9b72b
9 files changed
+717
-187
No files matched your search
@@ -1872,6 +1872,18 @@ public struct ColumnAssignment {
|
||||
}
|
||||
}
|
||||
|
||||
/// A strategy for updating database rows in case of upsert conflict.
|
||||
public struct UpsertUpdateStrategy: OptionSet, Sendable {
|
||||
public let rawValue: Int
|
||||
public init(rawValue: Int) { self.rawValue = rawValue }
|
||||
|
||||
/// Only the specified columns are updated in the existing row.
|
||||
public static let noColumnUnlessSpecified = Self([])
|
||||
|
||||
/// All columns are updated in the existing row, unless specified otherwise.
|
||||
public static let allColumns = Self(rawValue: 1 << 0)
|
||||
}
|
||||
|
||||
extension ColumnExpression {
|
||||
/// Returns an assignment of this column to an SQL expression.
|
||||
///
|
||||
|
||||
Reference in new issue
Block a user