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
- data SqliteInsertReturning (table :: (* -> *) -> *)
- insertReturning :: DatabaseEntity be db (TableEntity table) -> SqlInsertValues SqliteInsertValuesSyntax table -> 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 or use with withDbConnection
.
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 -> 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. Unfilled Auto
values in the table will have been filled in in
the output.