hdbc / hdbc-sqlite3

Sqlite v3 driver for HDBC
BSD 3-Clause "New" or "Revised" License
21 stars 6 forks source link

Throw slightly better errors by using prepare_V2 #5

Closed rassilon closed 13 years ago

rassilon commented 13 years ago

If I had more Haskell experience I'd probably add 2 new testcases:

CREATE TABLE blah (x INT NOT NULL)

prepare/execute (or run) "INSERT INTO blah VALUES (?);" Bind with: toSql (Nothing :: Maybe Int)

Expected result: seNativeError: 19 (SQLITE_CONSTRAINT) and seErrorMessage: (something about a constraint error).

Use this pattern with both prepare/execute (or run) and fexecuteRaw.

This is much better than before this change which would yield: SQLITE_ERROR 1 /* SQL error or missing database */

Thanks, Bill

jgoerzen commented 13 years ago

Thanks, Bill. Pulled and merged.