Skip to content

Commit f664ede

Browse files
committed
Cleaned up some comments
1 parent 0697fd9 commit f664ede

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

Database/SQLite3/Bindings/Types.hsc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,16 +328,12 @@ c_SQLITE_DETERMINISTIC = #{const SQLITE_DETERMINISTIC}
328328
newtype CError = CError CInt
329329
deriving (Eq, Show)
330330

331-
-- | Note that this is a partial function. If the error code is invalid, or
332-
-- perhaps introduced in a newer version of SQLite but this library has not
333-
-- been updated to support it, the result is undefined.
331+
-- | Calls 'error' if passed a 'CError' containing an invalid or unsupported
332+
-- SQLite result code.
334333
--
335-
-- To be clear, if 'decodeError' fails, it is /undefined behavior/, not an
336-
-- exception you can handle.
337-
--
338-
-- Therefore, do not use direct-sqlite with a different version of SQLite than
339-
-- the one bundled (currently, 3.24.0). If you do, ensure that 'decodeError'
340-
-- and 'decodeColumnType' are still exhaustive.
334+
-- When using the @systemlib@ Cabal flag, a newer system SQLite library may
335+
-- produce 'CError' values containing result codes that direct-sqlite does not
336+
-- recognize.
341337
decodeError :: CError -> Error
342338
decodeError (CError n) = case n of
343339
#{const SQLITE_OK} -> ErrorOK
@@ -561,8 +557,12 @@ encodeError err = CError $ case err of
561557
newtype CColumnType = CColumnType CInt
562558
deriving (Eq, Show)
563559

564-
-- | Note that this is a partial function.
565-
-- See 'decodeError' for more information.
560+
-- | Calls 'error' if passed a 'CColumnType' containing an invalid or
561+
-- unsupported SQLite column-type code.
562+
--
563+
-- When using the @systemlib@ Cabal flag, a newer system SQLite library may
564+
-- produce 'CColumnType' values containing column-type codes that direct-sqlite
565+
-- does not recognize.
566566
decodeColumnType :: CColumnType -> ColumnType
567567
decodeColumnType (CColumnType n) = case n of
568568
#{const SQLITE_INTEGER} -> IntegerColumn

direct-sqlite.cabal

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ source-repository head
3333

3434
flag systemlib
3535
default: False
36-
description: Use the system-wide sqlite library
36+
description:
37+
Use the system SQLite library instead of the bundled one.
38+
WARNING: An older system version may lack build-time definitions, while a
39+
newer one may return unrecognized values.
3740

3841
flag fulltextsearch
3942
default: True

0 commit comments

Comments
 (0)