Safe Haskell | None |
---|---|
Language | Haskell2010 |
Database.Selda.Backend
Description
API for building Selda backends.
- class Monad m => MonadIO m where
- type QueryRunner a = Text -> [Param] -> IO a
- data SeldaBackend = SeldaBackend {
- runStmt :: QueryRunner (Int, [[SqlValue]])
- runStmtWithPK :: QueryRunner Int
- customColType :: Text -> [ColAttr] -> Maybe Text
- defaultKeyword :: Text
- class MonadIO m => MonadSelda m where
- newtype SeldaT m a = S {
- unS :: StateT SeldaBackend m a
- data Param where
- data Lit a where
- data SqlValue where
- data ColAttr
- compileColAttr :: ColAttr -> Text
- sqlDateTimeFormat :: String
- sqlDateFormat :: String
- sqlTimeFormat :: String
- runSeldaT :: MonadIO m => SeldaT m a -> SeldaBackend -> m a
Documentation
class Monad m => MonadIO m where #
Monads in which IO
computations may be embedded.
Any monad built by applying a sequence of monad transformers to the
IO
monad will be an instance of this class.
Instances should satisfy the following laws, which state that liftIO
is a transformer of monads:
Minimal complete definition
Instances
MonadIO IO | |
MonadIO m => MonadIO (ListT m) | |
MonadIO m => MonadIO (MaybeT m) | |
MonadIO m => MonadIO (SeldaT m) # | |
(Error e, MonadIO m) => MonadIO (ErrorT e m) | |
MonadIO m => MonadIO (ExceptT e m) | |
MonadIO m => MonadIO (StateT s m) | |
MonadIO m => MonadIO (StateT s m) | |
(Monoid w, MonadIO m) => MonadIO (WriterT w m) | |
(Monoid w, MonadIO m) => MonadIO (WriterT w m) | |
MonadIO m => MonadIO (IdentityT * m) | |
MonadIO m => MonadIO (ContT * r m) | |
MonadIO m => MonadIO (ReaderT * r m) | |
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) | |
(Monoid w, MonadIO m) => MonadIO (RWST r w s m) | |
type QueryRunner a = Text -> [Param] -> IO a Source #
A function which executes a query and gives back a list of extensible tuples; one tuple per result row, and one tuple element per column.
data SeldaBackend Source #
A collection of functions making up a Selda backend.
Constructors
SeldaBackend | |
Fields
|
class MonadIO m => MonadSelda m where Source #
Some monad with Selda SQL capabilitites.
Minimal complete definition
Instances
MonadIO m => MonadSelda (SeldaT m) Source # | |
Monad transformer adding Selda SQL capabilities.
Constructors
S | |
Fields
|
Instances
MonadTrans SeldaT Source # | |
Monad m => Monad (SeldaT m) Source # | |
Functor m => Functor (SeldaT m) Source # | |
Monad m => Applicative (SeldaT m) Source # | |
MonadIO m => MonadIO (SeldaT m) Source # | |
MonadThrow m => MonadThrow (SeldaT m) Source # | |
MonadCatch m => MonadCatch (SeldaT m) Source # | |
MonadMask m => MonadMask (SeldaT m) Source # | |
MonadIO m => MonadSelda (SeldaT m) Source # | |
A parameter to a prepared SQL statement.
An SQL literal.
Some value that is representable in SQL.
Column attributes such as nullability, auto increment, etc. When adding elements, make sure that they are added in the order required by SQL syntax, as this list is only sorted before being pretty-printed.
Constructors
Primary | |
AutoIncrement | |
Required | |
Optional |
compileColAttr :: ColAttr -> Text Source #
Compile a column attribute.
sqlDateTimeFormat :: String Source #
Format string used to represent date and time when talking to the database backend.
sqlDateFormat :: String Source #
Format string used to represent date when talking to the database backend.
sqlTimeFormat :: String Source #
Format string used to represent time of day when talking to the database backend.