Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Sqlite = Sqlite
- newtype SqliteM a = SqliteM {
- runSqliteM :: ReaderT (String -> IO (), Connection) IO a
- sqliteUriSyntax :: c SqliteCommandSyntax Sqlite Connection SqliteM -> BeamURIOpeners c
- runBeamSqlite :: Connection -> SqliteM a -> IO a
- runBeamSqliteDebug :: (String -> IO ()) -> Connection -> SqliteM a -> IO a
- data SqliteInsertReturning (table :: (* -> *) -> *)
- insertReturning :: DatabaseEntity be db (TableEntity table) -> SqlInsertValues SqliteInsertValuesSyntax (table (QExpr SqliteExpressionSyntax s)) -> SqliteInsertReturning table
- runInsertReturningList :: FromBackendRow Sqlite (table Identity) => SqliteInsertReturning table -> SqliteM [table Identity]
Documentation
The SQLite backend. Used to parameterize MonadBeam
and FromBackendRow
to provide support for SQLite databases. See the documentation for
MonadBeam
and the user guide for more
information on how to use this backend.
MonadBeam
instance inside whiche SQLite queries are run. See the
user guide for more information
SqliteM | |
|
sqliteUriSyntax :: c SqliteCommandSyntax Sqlite Connection SqliteM -> BeamURIOpeners c Source #
URI syntax for use with withDbConnection
. See documentation for
BeamURIOpeners
for more information.
runBeamSqlite :: Connection -> SqliteM a -> IO a Source #
runBeamSqliteDebug :: (String -> IO ()) -> Connection -> SqliteM a -> IO a Source #
Emulated INSERT RETURNING
support
data SqliteInsertReturning (table :: (* -> *) -> *) Source #
Represents an INSERT
statement, from which we can retrieve inserted rows.
Beam also offers a backend-agnostic way of using this functionality in the
MonadBeamInsertReturning
extension. This functionality is emulated in
SQLite using a temporary table and a trigger.
insertReturning :: DatabaseEntity be db (TableEntity table) -> SqlInsertValues SqliteInsertValuesSyntax (table (QExpr SqliteExpressionSyntax s)) -> SqliteInsertReturning table Source #
Build a SqliteInsertReturning
representing inserting the given values
into the given table. Use runInsertReturningList
runInsertReturningList :: FromBackendRow Sqlite (table Identity) => SqliteInsertReturning table -> SqliteM [table Identity] Source #
Runs a SqliteInsertReturning
statement and returns a result for each
inserted row.