Safe Haskell | None |
---|---|
Language | Haskell2010 |
Top-level Beam module. This module re-exports all the symbols necessary for most common user operations.
The most interesting modules are Database.Beam.Schema and Database.Beam.Query.
This is mainly reference documentation. Most users will want to consult the manual.
The API has mostly stayed the same, but not all the examples given there compile.
- module Database.Beam.Query
- module Database.Beam.Schema
- class (BeamBackend be, Monad m, MonadIO m, Sql92SanityCheck syntax) => MonadBeam syntax be handle m | m -> syntax be handle where
- class BeamBackend be => FromBackendRow be a where
- class Monad m => MonadIO (m :: * -> *) where
- class Typeable k (a :: k)
- class Generic a
- data Identity a :: * -> *
Documentation
module Database.Beam.Query
module Database.Beam.Schema
class (BeamBackend be, Monad m, MonadIO m, Sql92SanityCheck syntax) => MonadBeam syntax be handle m | m -> syntax be handle where Source #
A class that ties together a Sql syntax, backend, handle, and monad type.
Intuitively, this allows you to write code that performs database commands
without having to know the underlying API. As long as you have an
appropriate handle from a database library that Beam can use, you can use
the MonadBeam
methods to execute the query.
Provided here is a low-level interface. Most often, you'll only need the
withDatabase
and withDatabaseDebug
function. The 'run*' functions are
wrapped by the appropriate functions in Database.Beam.Query.
This interface is very high-level and isn't meant to expose the full power
of the underlying database. Namely, it only supports simple data retrieval
strategies. More complicated strategies (for example, Postgres's COPY
)
are supported in individual backends. See the documentation of those
backends for more details.
:: (String -> IO ()) | Database statement logging function |
-> handle | The database connection handle against which to execute the action |
-> m a | The database action |
-> IO a |
Run a database action, and log debugging information about statements
executed using the specified IO
action.
withDatabase :: handle -> m a -> IO a Source #
class BeamBackend be => FromBackendRow be a where Source #
fromBackendRow :: FromBackendRowM be a Source #
fromBackendRow :: BackendFromField be a => FromBackendRowM be a Source #
Re-exports
The class Typeable
allows a concrete representation of a type to
be calculated.
typeRep#
Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.
Identity functor and monad. (a non-strict monad)
Since: 4.8.0.0