@@ -328,16 +328,12 @@ c_SQLITE_DETERMINISTIC = #{const SQLITE_DETERMINISTIC}
328328newtype 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.
341337decodeError :: CError -> Error
342338decodeError (CError n) = case n of
343339 # {const SQLITE_OK } -> ErrorOK
@@ -561,8 +557,12 @@ encodeError err = CError $ case err of
561557newtype 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.
566566decodeColumnType :: CColumnType -> ColumnType
567567decodeColumnType (CColumnType n) = case n of
568568 # {const SQLITE_INTEGER } -> IntegerColumn
0 commit comments