hpqtypes-1.12.0.0: Haskell bindings to libpqtypes
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.PostgreSQL.PQTypes.Utils

Synopsis

Documentation

throwDB :: (HasCallStack, Exception e, MonadDB m, MonadThrow m) => e -> m a Source #

When given DBException, throw it immediately. Otherwise wrap it in DBException with the current query context first.

raw :: RawSQL () -> SQL Source #

Convert RawSQL () to SQL.

runQuery_ :: (HasCallStack, IsSQL sql, MonadDB m) => sql -> m () Source #

Specialization of runQuery that discards the result.

runQuery01 :: (HasCallStack, IsSQL sql, MonadDB m, MonadThrow m) => sql -> m Bool Source #

Specialization of runQuery that checks whether affected/returned number of rows is in range [0, 1] and returns appropriate Bool value. Otherwise, AffectedRowsMismatch exception is thrown.

runQuery01_ :: (HasCallStack, IsSQL sql, MonadDB m, MonadThrow m) => sql -> m () Source #

Specialization of runQuery01 that discards the result.

runSQL :: (HasCallStack, MonadDB m) => SQL -> m Int Source #

Specialization of runQuery to SQL type.

runSQL_ :: (HasCallStack, MonadDB m) => SQL -> m () Source #

Specialization of runQuery_ to SQL type.

runSQL01 :: (HasCallStack, MonadDB m, MonadThrow m) => SQL -> m Bool Source #

Specialization of runQuery01 to SQL type.

runSQL01_ :: (HasCallStack, MonadDB m, MonadThrow m) => SQL -> m () Source #

Specialization of runQuery01_ to SQL type.

runPreparedQuery_ :: (HasCallStack, IsSQL sql, MonadDB m) => QueryName -> sql -> m () Source #

Specialization of runPreparedQuery that discards the result.

runPreparedQuery01 :: (HasCallStack, IsSQL sql, MonadDB m, MonadThrow m) => QueryName -> sql -> m Bool Source #

Specialization of runPreparedQuery that checks whether affected/returned number of rows is in range [0, 1] and returns appropriate Bool value. Otherwise, AffectedRowsMismatch exception is thrown.

runPreparedQuery01_ :: (HasCallStack, IsSQL sql, MonadDB m, MonadThrow m) => QueryName -> sql -> m () Source #

Specialization of runPreparedQuery01 that discards the result.

runPreparedSQL :: (HasCallStack, MonadDB m) => QueryName -> SQL -> m Int Source #

Specialization of runPreparedQuery to SQL type.

runPreparedSQL_ :: (HasCallStack, MonadDB m) => QueryName -> SQL -> m () Source #

Specialization of runPreparedQuery_ to SQL type.

runPreparedSQL01_ :: (HasCallStack, MonadDB m, MonadThrow m) => QueryName -> SQL -> m () Source #

Specialization of runPreparedQuery01_ to SQL type.

hpqTypesError :: String -> IO a Source #

Throw 'HPQTypesError exception.