Portability | unknown |
---|---|
Stability | experimental |
Maintainer | ex8k.hibino@gmail.com |
Safe Haskell | None |
This module defines typed SQL.
- newtype Query p a = Query {}
- unsafeTypedQuery :: String -> Query p a
- relationalQuery' :: Relation p r -> QuerySuffix -> Query p r
- relationalQuery :: Relation p r -> Query p r
- relationalQuerySQL :: Config -> Relation p r -> QuerySuffix -> String
- data KeyUpdate p a = KeyUpdate {
- updateKey :: Pi a p
- untypeKeyUpdate :: String
- unsafeTypedKeyUpdate :: Pi a p -> String -> KeyUpdate p a
- typedKeyUpdate :: Table a -> Pi a p -> KeyUpdate p a
- typedKeyUpdateTable :: TableDerivable r => Relation () r -> Pi r p -> KeyUpdate p r
- newtype Update p = Update {}
- unsafeTypedUpdate :: String -> Update p
- typedUpdate' :: Config -> Table r -> UpdateTarget p r -> Update p
- typedUpdate :: Table r -> UpdateTarget p r -> Update p
- derivedUpdate' :: TableDerivable r => Config -> UpdateTargetContext p r -> Update p
- derivedUpdate :: TableDerivable r => UpdateTargetContext p r -> Update p
- typedUpdateAllColumn :: PersistableWidth r => Table r -> Restriction p r -> Update (r, p)
- restrictedUpdateAllColumn :: PersistableWidth r => Table r -> RestrictionContext p r -> Update (r, p)
- restrictedUpdateTableAllColumn :: (PersistableWidth r, TableDerivable r) => Relation () r -> RestrictionContext p r -> Update (r, p)
- updateSQL :: Config -> Table r -> UpdateTarget p r -> String
- data Insert a = Insert {}
- unsafeTypedInsert' :: String -> String -> Int -> Insert a
- unsafeTypedInsert :: String -> Insert a
- typedInsert' :: Config -> Table r -> Pi r r' -> Insert r'
- typedInsert :: Table r -> Pi r r' -> Insert r'
- derivedInsert :: TableDerivable r => Pi r r' -> Insert r'
- newtype InsertQuery p = InsertQuery {}
- unsafeTypedInsertQuery :: String -> InsertQuery p
- typedInsertQuery' :: Config -> Table r -> Pi r r' -> Relation p r' -> InsertQuery p
- typedInsertQuery :: Table r -> Pi r r' -> Relation p r' -> InsertQuery p
- derivedInsertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery p
- insertQuerySQL :: Config -> Table r -> Pi r r' -> Relation p r' -> String
- newtype Delete p = Delete {}
- unsafeTypedDelete :: String -> Delete p
- typedDelete' :: Config -> Table r -> Restriction p r -> Delete p
- typedDelete :: Table r -> Restriction p r -> Delete p
- derivedDelete' :: TableDerivable r => Config -> RestrictionContext p r -> Delete p
- derivedDelete :: TableDerivable r => RestrictionContext p r -> Delete p
- deleteSQL :: Config -> Table r -> Restriction p r -> String
- class UntypeableNoFetch s where
- untypeNoFetch :: s p -> String
Typed query statement
Query type with place-holder parameter p
and query result type a
.
Unsafely make typed Query
from SQL string.
relationalQuery' :: Relation p r -> QuerySuffix -> Query p rSource
relationalQuerySQL :: Config -> Relation p r -> QuerySuffix -> StringSource
From Relation
into untyped SQL query string.
Typed update statement
Update type with key type p
and update record type a
.
Columns to update are record columns other than key columns,
So place-holder parameter type is the same as record type a
.
KeyUpdate | |
|
unsafeTypedKeyUpdate :: Pi a p -> String -> KeyUpdate p aSource
Unsafely make typed KeyUpdate
from SQL string.
typedKeyUpdate :: Table a -> Pi a p -> KeyUpdate p aSource
typedKeyUpdateTable :: TableDerivable r => Relation () r -> Pi r p -> KeyUpdate p rSource
Update type with place-holder parameter p
.
UntypeableNoFetch Update | |
Show (Update p) | Show update SQL string |
unsafeTypedUpdate :: String -> Update pSource
Unsafely make typed Update
from SQL string.
typedUpdate' :: Config -> Table r -> UpdateTarget p r -> Update pSource
Make typed Update
from Config
, Table
and UpdateTarget
.
typedUpdate :: Table r -> UpdateTarget p r -> Update pSource
Make typed Update
using defaultConfig
, Table
and UpdateTarget
.
derivedUpdate' :: TableDerivable r => Config -> UpdateTargetContext p r -> Update pSource
Make typed Update
from Config
, derived table and UpdateTargetContext
derivedUpdate :: TableDerivable r => UpdateTargetContext p r -> Update pSource
Make typed Update
from defaultConfig
, derived table and UpdateTargetContext
typedUpdateAllColumn :: PersistableWidth r => Table r -> Restriction p r -> Update (r, p)Source
Make typed Update
from Table
and Restriction
.
Update target is all column.
restrictedUpdateAllColumnSource
:: PersistableWidth r | |
=> Table r | |
-> RestrictionContext p r |
|
-> Update (r, p) |
restrictedUpdateTableAllColumn :: (PersistableWidth r, TableDerivable r) => Relation () r -> RestrictionContext p r -> Update (r, p)Source
updateSQL :: Config -> Table r -> UpdateTarget p r -> StringSource
Make untyped update SQL string from Table
and UpdateTarget
.
Typed insert statement
Insert type to insert record type a
.
UntypeableNoFetch Insert | |
Show (Insert a) | Show insert SQL string. |
unsafeTypedInsert' :: String -> String -> Int -> Insert aSource
Unsafely make typed Insert
from single insert and chunked insert SQL.
unsafeTypedInsert :: String -> Insert aSource
Unsafely make typed Insert
from single insert SQL.
typedInsert :: Table r -> Pi r r' -> Insert r'Source
derivedInsert :: TableDerivable r => Pi r r' -> Insert r'Source
Table type infered Insert
.
unsafeTypedInsertQuery :: String -> InsertQuery pSource
Unsafely make typed InsertQuery
from SQL string.
typedInsertQuery' :: Config -> Table r -> Pi r r' -> Relation p r' -> InsertQuery pSource
Make typed InsertQuery
from columns selector Table
, Pi
and Relation
with configuration parameter.
typedInsertQuery :: Table r -> Pi r r' -> Relation p r' -> InsertQuery pSource
Make typed InsertQuery
from columns selector Table
, Pi
and Relation
.
derivedInsertQuery :: TableDerivable r => Pi r r' -> Relation p r' -> InsertQuery pSource
Table type infered InsertQuery
.
Typed delete statement
Delete type with place-holder parameter p
.
UntypeableNoFetch Delete | |
Show (Delete p) | Show delete SQL string |
unsafeTypedDelete :: String -> Delete pSource
Unsafely make typed Delete
from SQL string.
typedDelete' :: Config -> Table r -> Restriction p r -> Delete pSource
Make typed Delete
from Config
, Table
and Restriction
.
typedDelete :: Table r -> Restriction p r -> Delete pSource
Make typed Delete
from Table
and Restriction
.
derivedDelete' :: TableDerivable r => Config -> RestrictionContext p r -> Delete pSource
derivedDelete :: TableDerivable r => RestrictionContext p r -> Delete pSource
Make typed Delete
from defaultConfig
, derived table and RestrictContext
deleteSQL :: Config -> Table r -> Restriction p r -> StringSource
Make untyped delete SQL string from Table
and Restriction
.
Generalized interfaces
class UntypeableNoFetch s whereSource
Untype interface for typed no-result type statments
with single type parameter which represents place-holder parameter p
.
untypeNoFetch :: s p -> StringSource