| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Database.PostgreSQL.PQTypes.Internal.Utils
Synopsis
- type family MkConstraint (m :: Type -> Type) (cs :: [(Type -> Type) -> Constraint]) where ...
- mread :: Read a => String -> Maybe a
- safePeekCString :: CString -> IO (Maybe String)
- safePeekCString' :: CString -> IO String
- cStringLenToBytea :: CStringLen -> PGbytea
- byteaToCStringLen :: PGbytea -> CStringLen
- textToCString :: Text -> IO (ForeignPtr CChar)
- verifyPQTRes :: HasCallStack => Ptr PGerror -> String -> CInt -> IO ()
- withPGparam :: HasCallStack => Ptr PGconn -> (Ptr PGparam -> IO r) -> IO r
- throwLibPQError :: HasCallStack => Ptr PGconn -> String -> IO a
- throwLibPQTypesError :: HasCallStack => Ptr PGerror -> String -> IO a
- rethrowWithArrayError :: HasCallStack => CInt -> SomeException -> IO a
- hpqTypesError :: HasCallStack => String -> IO a
- unexpectedNULL :: HasCallStack => IO a
Documentation
type family MkConstraint (m :: Type -> Type) (cs :: [(Type -> Type) -> Constraint]) where ... Source #
Equations
| MkConstraint m ('[] :: [(Type -> Type) -> Constraint]) = () | |
| MkConstraint m (c ': cs) = (c m, MkConstraint m cs) |
cStringLenToBytea :: CStringLen -> PGbytea Source #
Convert C string to PGbytea.
byteaToCStringLen :: PGbytea -> CStringLen Source #
Convert PGbytea to C string.
textToCString :: Text -> IO (ForeignPtr CChar) Source #
Convert Text to UTF-8 encoded C string wrapped by foreign pointer.
verifyPQTRes :: HasCallStack => Ptr PGerror -> String -> CInt -> IO () Source #
Check return value of a function from libpqtypes and if it indicates an error, throw appropriate exception.
withPGparam :: HasCallStack => Ptr PGconn -> (Ptr PGparam -> IO r) -> IO r Source #
throwLibPQError :: HasCallStack => Ptr PGconn -> String -> IO a Source #
Throw libpq specific error.
throwLibPQTypesError :: HasCallStack => Ptr PGerror -> String -> IO a Source #
Throw libpqtypes specific error.
rethrowWithArrayError :: HasCallStack => CInt -> SomeException -> IO a Source #
Rethrow supplied exception enriched with array index.
hpqTypesError :: HasCallStack => String -> IO a Source #
Throw 'HPQTypesError exception.
unexpectedNULL :: HasCallStack => IO a Source #
Throw 'unexpected NULL' exception.