{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
module Opaleye.Table (
table,
tableWithSchema,
T.Table,
T.tableField,
T.optionalTableField,
T.readOnlyTableField,
T.requiredTableField,
selectTable,
T.TableColumns,
TableFields,
selectTableExplicit,
T.optional,
T.readOnly,
T.required,
T.tableColumn,
View,
Writer,
T.Table(T.Table, T.TableWithSchema),
queryTable,
queryTableExplicit) where
import qualified Opaleye.Internal.QueryArr as Q
import qualified Opaleye.Internal.Table as T
import Opaleye.Internal.Table (View, Table, Writer,
TableFields)
import qualified Opaleye.Internal.Tag as Tag
import qualified Opaleye.Internal.Unpackspec as U
import qualified Opaleye.Select as S
import qualified Data.Profunctor.Product.Default as D
selectTable :: D.Default U.Unpackspec fields fields
=> Table a fields
-> S.Select fields
selectTable :: Table a fields -> Select fields
selectTable = Unpackspec fields fields -> Table a fields -> Select fields
forall tablefields fields a.
Unpackspec tablefields fields
-> Table a tablefields -> Select fields
selectTableExplicit Unpackspec fields fields
forall (p :: * -> * -> *) a b. Default p a b => p a b
D.def
table :: String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
table :: String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
table = String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
forall writeFields viewFields.
String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
T.Table
tableWithSchema :: String
-> String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
tableWithSchema :: String
-> String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
tableWithSchema = String
-> String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
forall writeFields viewFields.
String
-> String
-> TableFields writeFields viewFields
-> Table writeFields viewFields
T.TableWithSchema
selectTableExplicit :: U.Unpackspec tablefields fields
-> Table a tablefields
-> S.Select fields
selectTableExplicit :: Unpackspec tablefields fields
-> Table a tablefields -> Select fields
selectTableExplicit Unpackspec tablefields fields
cm Table a tablefields
table' = (((), Tag) -> (fields, PrimQuery, Tag)) -> Select fields
forall a b. ((a, Tag) -> (b, PrimQuery, Tag)) -> QueryArr a b
Q.productQueryArr ((), Tag) -> (fields, PrimQuery, Tag)
f where
f :: ((), Tag) -> (fields, PrimQuery, Tag)
f ((), Tag
t0) = (fields
retwires, PrimQuery
primQ, Tag -> Tag
Tag.next Tag
t0) where
(fields
retwires, PrimQuery
primQ) = Unpackspec tablefields fields
-> Table a tablefields -> Tag -> (fields, PrimQuery)
forall viewColumns columns writeColumns.
Unpackspec viewColumns columns
-> Table writeColumns viewColumns -> Tag -> (columns, PrimQuery)
T.queryTable Unpackspec tablefields fields
cm Table a tablefields
table' Tag
t0
{-# DEPRECATED queryTable "Use 'selectTable' instead. Will be removed in version 0.8." #-}
queryTable :: D.Default U.Unpackspec fields fields =>
Table a fields -> S.Select fields
queryTable :: Table a fields -> Select fields
queryTable = Table a fields -> Select fields
forall fields a.
Default Unpackspec fields fields =>
Table a fields -> Select fields
selectTable
{-# DEPRECATED queryTableExplicit "Use 'selectTableExplicit' instead. Will be removed in version 0.8." #-}
queryTableExplicit :: U.Unpackspec tablefields fields ->
Table a tablefields -> S.Select fields
queryTableExplicit :: Unpackspec tablefields fields
-> Table a tablefields -> Select fields
queryTableExplicit = Unpackspec tablefields fields
-> Table a tablefields -> Select fields
forall tablefields fields a.
Unpackspec tablefields fields
-> Table a tablefields -> Select fields
selectTableExplicit