System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Ticket Hash: 71bedaca19d94cb6b6c6c2f3deb293b71a2b3133
Title: Add enumeration for extended return codes
Status: Closed Type: Feature_Request
Severity: Minor Priority: Medium
Subsystem: Convert Resolution: Fixed
Last Modified: 2015-07-13 19:51:41
Version Found In: 1.0.98.0
User Comments:
anonymous added on 2015-06-02 07:37:38:

I think there should be an enum SQLiteExtendedResultCode mapping to those described here.

It's rather cumbersome to be able to write
SQLiteErrorCode errorCode = myConnection.ExtendedResultCode();
if (errorCode == SQLiteErrorCode.Constraint)
doSomething();

but then having to write
if ((int)errorCode == 1555 /* SQLiteExtendedResultCode.ConstraintPrimaryKey */)
doSomething();

It would also be nice to have SQLiteException.ErrorCode being an SQLiteErrorCode instead of an int.


anonymous added on 2015-07-13 11:33:19:

Moreover: even after setting myConnection.SetExtendedResultCodes(true) I would have expected myConnection.ResultCode() to still deliver one of the 31 Primary Result Codes - why else should there be a method myConnection.ExtendedResultCode()? The documentation here is by the way erroneous because it says for all three methods "Enables or disabled extended result codes returned by SQLite".
Regards, Bernd


mistachkin added on 2015-07-13 19:51:41:
Fixed on trunk via check-in [42798551ca].  Instead of creating a new enumeration,
the existing one was updated to include the extended return codes.