hpqtypes-1.6.0.0: Haskell bindings to libpqtypes

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Internal.Utils

Synopsis

Documentation

type family MkConstraint (m :: * -> *) (cs :: [(* -> *) -> Constraint]) :: Constraint where ... Source #

Equations

MkConstraint m '[] = () 
MkConstraint m (c ': cs) = (c m, MkConstraint m cs) 

mread :: Read a => String -> Maybe a Source #

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

Safely peek C string.

safePeekCString' :: CString -> IO String Source #

Safely peek C string and return "" if NULL.

textToCString :: Text -> IO (ForeignPtr CChar) Source #

Convert Text to UTF-8 encoded 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.