ResultCode
An SQLite result code.
-
The raw SQLite result code
-
Creates a
ResultCode
from a raw SQLite result code. -
A result code limited to the least significant 8 bits of the receiver. See https://www.sqlite.org/rescode.html for more information.
let resultCode = .SQLITE_CONSTRAINT_FOREIGNKEY resultCode.primaryResultCode == .SQLITE_CONSTRAINT // true
-
Returns true if the code on the left matches the code on the right.
Primary result codes match themselves and their extended result codes, while extended result codes match only themselves:
switch error.extendedResultCode { case .SQLITE_CONSTRAINT_FOREIGNKEY: // foreign key constraint error case .SQLITE_CONSTRAINT: // any other constraint error default: // any other database error }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-