Skip to content

Commit

Permalink
Tiny improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoarment committed Oct 24, 2023
1 parent deaf003 commit dce897a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let package = Package(
name: "Blackbird",
dependencies: [],
swiftSettings: [
// .unsafeFlags(["-Xfrontend", "-warn-concurrency"]) // Uncomment for Sendable testing
// .enableExperimentalFeature("StrictConcurrency"), // Uncomment for Sendable testing
]
),
.testTarget(
Expand Down
6 changes: 6 additions & 0 deletions Sources/Blackbird/BlackbirdChanges.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ public extension Blackbird {
guard let columnNames else { return true }
return columnNames.contains(T.table.keyPathToColumnName(keyPath: keyPath))
}

/// The set of primary-key values that may have changed, or `nil` if any primary key may have changed.
public var changedPrimaryKeys: PrimaryKeyValues? {
if let primaryKeys, primaryKeys.count > 0 { return primaryKeys }
return nil
}

internal init(type: T.Type, from change: Change) {
self.type = type
Expand Down

0 comments on commit dce897a

Please sign in to comment.