beam-sqlite-0.2.0.0: Beam driver for SQLite

Safe HaskellNone
LanguageHaskell2010

Database.Beam.Sqlite.Connection

Contents

Synopsis

Documentation

data Sqlite Source #

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.

Constructors

Sqlite 

Instances

BeamSql92Backend Sqlite Source # 
BeamSqlBackend Sqlite Source # 
BeamBackend Sqlite Source # 

Associated Types

type BackendFromField Sqlite :: * -> Constraint #

FromBackendRow Sqlite Bool Source # 
FromBackendRow Sqlite Char Source # 
FromBackendRow Sqlite Double Source # 
FromBackendRow Sqlite Float Source # 
FromBackendRow Sqlite Int Source # 
FromBackendRow Sqlite Int8 Source # 
FromBackendRow Sqlite Int16 Source # 
FromBackendRow Sqlite Int32 Source # 
FromBackendRow Sqlite Int64 Source # 
FromBackendRow Sqlite Integer Source # 
FromBackendRow Sqlite Word Source # 
FromBackendRow Sqlite Word8 Source # 
FromBackendRow Sqlite Word16 Source # 
FromBackendRow Sqlite Word32 Source # 
FromBackendRow Sqlite Word64 Source # 
FromBackendRow Sqlite ByteString Source # 
FromBackendRow Sqlite ByteString Source # 
FromBackendRow Sqlite Scientific Source # 
FromBackendRow Sqlite Text Source # 
FromBackendRow Sqlite UTCTime Source # 
FromBackendRow Sqlite Text Source # 
FromBackendRow Sqlite SqlNull Source # 
FromBackendRow Sqlite Null Source # 
FromBackendRow Sqlite LocalTime Source # 
FromBackendRow Sqlite Day Source # 
MonadBeamInsertReturning SqliteCommandSyntax Sqlite Connection SqliteM Source # 
MonadBeam SqliteCommandSyntax Sqlite Connection SqliteM Source # 
type BackendFromField Sqlite Source # 

newtype SqliteM a Source #

MonadBeam instance inside whiche SQLite queries are run. See the user guide for more information

Constructors

SqliteM 

Fields

  • runSqliteM :: ReaderT (String -> IO (), Connection) IO a

    Run an IO action with access to a SQLite connection and a debug logging function, called or each query submitted on the connection.

Instances

Monad SqliteM Source # 

Methods

(>>=) :: SqliteM a -> (a -> SqliteM b) -> SqliteM b #

(>>) :: SqliteM a -> SqliteM b -> SqliteM b #

return :: a -> SqliteM a #

fail :: String -> SqliteM a #

Functor SqliteM Source # 

Methods

fmap :: (a -> b) -> SqliteM a -> SqliteM b #

(<$) :: a -> SqliteM b -> SqliteM a #

Applicative SqliteM Source # 

Methods

pure :: a -> SqliteM a #

(<*>) :: SqliteM (a -> b) -> SqliteM a -> SqliteM b #

liftA2 :: (a -> b -> c) -> SqliteM a -> SqliteM b -> SqliteM c #

(*>) :: SqliteM a -> SqliteM b -> SqliteM b #

(<*) :: SqliteM a -> SqliteM b -> SqliteM a #

MonadIO SqliteM Source # 

Methods

liftIO :: IO a -> SqliteM a #

MonadBeamInsertReturning SqliteCommandSyntax Sqlite Connection SqliteM Source # 
MonadBeam SqliteCommandSyntax Sqlite Connection SqliteM 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 -> 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.

Orphan instances