sqlite-easy-0.1.0.0: A primitive yet easy to use sqlite library.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Sqlite.Easy.Internal

Synopsis

Connection

newtype ConnectionString Source #

A SQLite3 connection string

Constructors

ConnectionString 

createSqlitePool :: ConnectionString -> IO (Pool Database) Source #

Create a pool of a sqlite3 db with a specific connection string.

withDb :: ConnectionString -> (Database -> IO a) -> IO a Source #

Open a database, run some stuff, close the database.

Execution

newtype SQL Source #

A SQL statement

Constructors

SQL 

Fields

Instances

Instances details
IsString SQL Source # 
Instance details

Defined in Database.Sqlite.Easy.Internal

Methods

fromString :: String -> SQL #

Semigroup SQL Source # 
Instance details

Defined in Database.Sqlite.Easy.Internal

Methods

(<>) :: SQL -> SQL -> SQL #

sconcat :: NonEmpty SQL -> SQL #

stimes :: Integral b => b -> SQL -> SQL #

Show SQL Source # 
Instance details

Defined in Database.Sqlite.Easy.Internal

Methods

showsPrec :: Int -> SQL -> ShowS #

show :: SQL -> String #

showList :: [SQL] -> ShowS #

run :: SQL -> Database -> IO [[SQLData]] Source #

Run a SQL statement on a database and fetch the results.

runWith :: SQL -> [SQLData] -> Database -> IO [[SQLData]] Source #

Run a SQL statement with certain parameters on a database and fetch the results.

fetchAll :: Statement -> IO [[SQLData]] Source #

Run a statement and fetch all of the data.

Transaction

asTransaction :: Typeable a => Database -> IO a -> IO a Source #

Run operations as a transaction. If the action throws an error, the transaction is rolled back.

Note: Transactions do not nest.

For more information, visit: https://www.sqlite.org/lang_transaction.html

cancelTransaction :: Typeable a => a -> IO a Source #

Cancel a transaction by supplying the return value. To be used inside transactions.