selda-0.5.1.0: Multi-backend, high-level EDSL for interacting with SQL databases.

Safe HaskellNone
LanguageHaskell2010

Database.Selda.Debug

Description

Functionality for inspecting and debugging Selda queries.

Synopsis

Documentation

data OnError Source #

Constructors

Fail 
Ignore 
Instances
Eq OnError Source # 
Instance details

Defined in Database.Selda.Table.Compile

Methods

(==) :: OnError -> OnError -> Bool #

(/=) :: OnError -> OnError -> Bool #

Ord OnError Source # 
Instance details

Defined in Database.Selda.Table.Compile

Show OnError Source # 
Instance details

Defined in Database.Selda.Table.Compile

defPPConfig :: PPConfig Source #

Default settings for pretty-printing. Geared towards SQLite.

The default definition of ppTypePK is 'defType, so that you don’t have to do anything special if you don’t use special types for primary keys.

compile :: Result a => Query s a -> (Text, [Param]) Source #

Compile a query into a parameterised SQL statement.

The types given are tailored for SQLite. To translate SQLite types into whichever types are used by your backend, use compileWith.

compileCreateTable :: PPConfig -> OnError -> Table a -> Text Source #

Compile a sequence of queries to create the given table, including indexes. The first query in the sequence is always CREATE TABLE.

compileDropTable :: OnError -> Table a -> Text Source #

Compile a DROP TABLE query.

compileInsert :: Relational a => PPConfig -> Table a -> [a] -> [(Text, [Param])] Source #

Compile an INSERT query, given the keyword representing default values in the target SQL dialect, a table and a list of items corresponding to the table.

compileUpdate Source #

Arguments

:: (Relational a, SqlRow a) 
=> PPConfig 
-> Table a

Table to update.

-> (Row s a -> Row s a)

Update function.

-> (Row s a -> Col s Bool)

Predicate.

-> (Text, [Param]) 

Compile an UPDATE query.