You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a type implementing SQLDatabaseReportedVersion, vend it from SQLiteDatabase, and use it to enable version-dependent RETURNING and UPSERT support for SQLite.
/// Build a version value from individual components and synthesize the approiate string value.
37
+
init(major:Int, minor:Int, patch:Int){
38
+
self.init(intValue: major *1_000_000+ minor *1_000+ patch)
39
+
}
40
+
41
+
/// Designated initializer. Build a version value from the combined numeric value and a corresponding string value.
42
+
/// If the string value is omitted, it is synthesized
43
+
init(intValue:Int, stringValue:String?=nil){
44
+
letcomponents=Self.components(of: intValue)
45
+
46
+
self.intValue = intValue
47
+
iflet stringValue = stringValue {
48
+
assert(stringValue.hasPrefix("\(components.major).\(components.minor).\(components.patch)"),"SQLite version string '\(stringValue)' must match numeric version '\(intValue)'")
0 commit comments