relational-query-0.8.3.8: Typeful, Modular, Relational, algebraic query engine

Copyright2013-2017 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Query.SQL

Contents

Description

This module defines functions to generate simple SQL strings.

Synopsis

Query suffix

type QuerySuffix = [Keyword] Source #

Type for query suffix words

showsQuerySuffix :: QuerySuffix -> StringSQL Source #

Expand query suffix words

Update SQL

updatePrefixSQL :: Table r -> StringSQL Source #

Generate prefix string of update SQL.

updateSQL' Source #

Arguments

:: String

Table name

-> [StringSQL]

Column name list to update

-> [StringSQL]

Key column name list

-> String

Result SQL

Generate update SQL by specified key and table. Columns name list of table are also required.

updateOtherThanKeySQL' Source #

Arguments

:: String

Table name

-> [StringSQL]

Column name list

-> [Int]

Key column indexes

-> String

Result SQL

Generate update SQL by specified key and table. Columns name list of table are also required.

updateOtherThanKeySQL Source #

Arguments

:: Table r

Table metadata

-> Pi r p

Key columns

-> String

Result SQL

Generate update SQL specified by single key.

Insert SQL

insertPrefixSQL :: Pi r r' -> Table r -> StringSQL Source #

Generate prefix string of insert SQL.

insertSQL Source #

Arguments

:: Pi r r'

Columns selector to insert

-> Table r

Table metadata

-> String

Result SQL

Generate insert SQL.

insertSizedChunkSQL Source #

Arguments

:: Pi r r'

Columns selector to insert

-> Table r

Table metadata

-> Int

Chunk size threshold (column count)

-> (String, Int)

Result SQL and records count of chunk

Generate size measured records chunk insert SQL.

Delete SQL

deletePrefixSQL' :: String -> StringSQL Source #

Generate all column delete SQL by specified table. Untyped table version.

deletePrefixSQL Source #

Arguments

:: Table r

Table metadata

-> StringSQL

Result SQL

Generate all column delete SQL by specified table.