Safe Haskell | None |
---|---|
Language | Haskell2010 |
Functionality for inspecting and debugging Selda queries.
Synopsis
- data OnError
- defPPConfig :: PPConfig
- compile :: Result a => Query s a -> (Text, [Param])
- compileCreateTable :: PPConfig -> OnError -> Table a -> Text
- compileDropTable :: OnError -> Table a -> Text
- compileInsert :: Relational a => PPConfig -> Table a -> [a] -> [(Text, [Param])]
- compileUpdate :: forall s a. (Relational a, SqlRow a) => PPConfig -> Table a -> (Row s a -> Row s a) -> (Row s a -> Col s Bool) -> (Text, [Param])
Documentation
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
.
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.