pipes-sqlite-simple-0.2: Functions that smash Pipes and sqlite-simple together

Safe HaskellNone
LanguageHaskell2010

Pipes.SQLite

Contents

Synopsis

Producers - turn a query into a stream of results

query :: (MonadSafe m, FromRow a, ToRow params) => Connection -> Query -> params -> Producer' a m () Source

Run a query with parameters and yield each parsed row in the result.

query_ :: (MonadSafe m, FromRow a) => Connection -> Query -> Producer' a m () Source

Run a parameterless query and yield each parsed row in the result.

queryNamed :: (MonadSafe m, FromRow a) => Connection -> Query -> [NamedParam] -> Producer' a m () Source

Run a query with named parameters and yield each parsed row in the result.

eachRow :: (MonadIO m, FromRow a) => Statement -> Producer' a m () Source

Yields each row in the given Statement. It is assumed that the statement has already been opened.

Consumers - execute a statement using upstream values as bound parameters

execute :: (MonadIO m, ToRow q) => Connection -> Query -> Consumer' q m b Source

Executes the SQL statment by binding each value provided by each upstream yield.

executeNamed :: MonadIO m => Connection -> Query -> Consumer' [NamedParam] m b Source

Executes the SQL statement with the set of bound parameters provided by each upstream yield.