hpqtypes-1.4.0: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell98

Database.PostgreSQL.PQTypes.Internal.Utils

Synopsis

Documentation

safePeekCString :: CString -> IO (Maybe String) Source

Safely peek C string.

safePeekCString' :: CString -> IO String Source

Safely peek C string and return "" if NULL.

bsToCString :: ByteString -> IO (ForeignPtr CChar) Source

Convert ByteString to C string wrapped by foreign pointer.

verifyPQTRes :: Ptr PGerror -> String -> CInt -> IO () Source

Check return value of a function from libpqtypes and if it indicates an error, throw appropriate exception.

throwLibPQError :: Ptr PGconn -> String -> IO a Source

Throw libpq specific error.

throwLibPQTypesError :: Ptr PGerror -> String -> IO a Source

Throw libpqtypes specific error.

rethrowWithArrayError :: CInt -> SomeException -> IO a Source

Rethrow supplied exception enriched with array index.

hpqTypesError :: String -> IO a Source

Throw 'HPQTypesError exception.

unexpectedNULL :: IO a Source

Throw 'unexpected NULL' exception.