module Opaleye.SQLite.Internal.HaskellDB.PrimQuery where
import qualified Opaleye.SQLite.Internal.Tag as T
import Data.ByteString (ByteString)
type TableName = String
type Attribute = String
type Name = String
type Scheme = [Attribute]
type Assoc = [(Attribute,PrimExpr)]
data Symbol = Symbol String T.Tag deriving (ReadPrec [Symbol]
ReadPrec Symbol
Int -> ReadS Symbol
ReadS [Symbol]
(Int -> ReadS Symbol)
-> ReadS [Symbol]
-> ReadPrec Symbol
-> ReadPrec [Symbol]
-> Read Symbol
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Symbol]
$creadListPrec :: ReadPrec [Symbol]
readPrec :: ReadPrec Symbol
$creadPrec :: ReadPrec Symbol
readList :: ReadS [Symbol]
$creadList :: ReadS [Symbol]
readsPrec :: Int -> ReadS Symbol
$creadsPrec :: Int -> ReadS Symbol
Read, Int -> Symbol -> ShowS
[Symbol] -> ShowS
Symbol -> String
(Int -> Symbol -> ShowS)
-> (Symbol -> String) -> ([Symbol] -> ShowS) -> Show Symbol
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Symbol] -> ShowS
$cshowList :: [Symbol] -> ShowS
show :: Symbol -> String
$cshow :: Symbol -> String
showsPrec :: Int -> Symbol -> ShowS
$cshowsPrec :: Int -> Symbol -> ShowS
Show)
data PrimExpr = AttrExpr Symbol
| BaseTableAttrExpr Attribute
| BinExpr BinOp PrimExpr PrimExpr
| UnExpr UnOp PrimExpr
| AggrExpr AggrOp PrimExpr
| ConstExpr Literal
| CaseExpr [(PrimExpr,PrimExpr)] PrimExpr
| ListExpr [PrimExpr]
| ParamExpr (Maybe Name) PrimExpr
| FunExpr Name [PrimExpr]
| CastExpr Name PrimExpr
| DefaultInsertExpr
deriving (ReadPrec [PrimExpr]
ReadPrec PrimExpr
Int -> ReadS PrimExpr
ReadS [PrimExpr]
(Int -> ReadS PrimExpr)
-> ReadS [PrimExpr]
-> ReadPrec PrimExpr
-> ReadPrec [PrimExpr]
-> Read PrimExpr
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PrimExpr]
$creadListPrec :: ReadPrec [PrimExpr]
readPrec :: ReadPrec PrimExpr
$creadPrec :: ReadPrec PrimExpr
readList :: ReadS [PrimExpr]
$creadList :: ReadS [PrimExpr]
readsPrec :: Int -> ReadS PrimExpr
$creadsPrec :: Int -> ReadS PrimExpr
Read,Int -> PrimExpr -> ShowS
[PrimExpr] -> ShowS
PrimExpr -> String
(Int -> PrimExpr -> ShowS)
-> (PrimExpr -> String) -> ([PrimExpr] -> ShowS) -> Show PrimExpr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrimExpr] -> ShowS
$cshowList :: [PrimExpr] -> ShowS
show :: PrimExpr -> String
$cshow :: PrimExpr -> String
showsPrec :: Int -> PrimExpr -> ShowS
$cshowsPrec :: Int -> PrimExpr -> ShowS
Show)
data Literal = NullLit
| DefaultLit
| BoolLit Bool
| StringLit String
| ByteStringLit ByteString
| IntegerLit Integer
| DoubleLit Double
| OtherLit String
deriving (ReadPrec [Literal]
ReadPrec Literal
Int -> ReadS Literal
ReadS [Literal]
(Int -> ReadS Literal)
-> ReadS [Literal]
-> ReadPrec Literal
-> ReadPrec [Literal]
-> Read Literal
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Literal]
$creadListPrec :: ReadPrec [Literal]
readPrec :: ReadPrec Literal
$creadPrec :: ReadPrec Literal
readList :: ReadS [Literal]
$creadList :: ReadS [Literal]
readsPrec :: Int -> ReadS Literal
$creadsPrec :: Int -> ReadS Literal
Read,Int -> Literal -> ShowS
[Literal] -> ShowS
Literal -> String
(Int -> Literal -> ShowS)
-> (Literal -> String) -> ([Literal] -> ShowS) -> Show Literal
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Literal] -> ShowS
$cshowList :: [Literal] -> ShowS
show :: Literal -> String
$cshow :: Literal -> String
showsPrec :: Int -> Literal -> ShowS
$cshowsPrec :: Int -> Literal -> ShowS
Show)
data BinOp = OpEq | OpLt | OpLtEq | OpGt | OpGtEq | OpNotEq
| OpAnd | OpOr
| OpLike | OpIn
| OpOther String
| OpCat
| OpPlus | OpMinus | OpMul | OpDiv | OpMod
| OpBitNot | OpBitAnd | OpBitOr | OpBitXor
| OpAsg
deriving (Int -> BinOp -> ShowS
[BinOp] -> ShowS
BinOp -> String
(Int -> BinOp -> ShowS)
-> (BinOp -> String) -> ([BinOp] -> ShowS) -> Show BinOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BinOp] -> ShowS
$cshowList :: [BinOp] -> ShowS
show :: BinOp -> String
$cshow :: BinOp -> String
showsPrec :: Int -> BinOp -> ShowS
$cshowsPrec :: Int -> BinOp -> ShowS
Show,ReadPrec [BinOp]
ReadPrec BinOp
Int -> ReadS BinOp
ReadS [BinOp]
(Int -> ReadS BinOp)
-> ReadS [BinOp]
-> ReadPrec BinOp
-> ReadPrec [BinOp]
-> Read BinOp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BinOp]
$creadListPrec :: ReadPrec [BinOp]
readPrec :: ReadPrec BinOp
$creadPrec :: ReadPrec BinOp
readList :: ReadS [BinOp]
$creadList :: ReadS [BinOp]
readsPrec :: Int -> ReadS BinOp
$creadsPrec :: Int -> ReadS BinOp
Read)
data UnOp = OpNot
| OpIsNull
| OpIsNotNull
| OpLength
| OpAbs
| OpNegate
| OpLower
| OpUpper
| UnOpOther String
deriving (Int -> UnOp -> ShowS
[UnOp] -> ShowS
UnOp -> String
(Int -> UnOp -> ShowS)
-> (UnOp -> String) -> ([UnOp] -> ShowS) -> Show UnOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnOp] -> ShowS
$cshowList :: [UnOp] -> ShowS
show :: UnOp -> String
$cshow :: UnOp -> String
showsPrec :: Int -> UnOp -> ShowS
$cshowsPrec :: Int -> UnOp -> ShowS
Show,ReadPrec [UnOp]
ReadPrec UnOp
Int -> ReadS UnOp
ReadS [UnOp]
(Int -> ReadS UnOp)
-> ReadS [UnOp] -> ReadPrec UnOp -> ReadPrec [UnOp] -> Read UnOp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UnOp]
$creadListPrec :: ReadPrec [UnOp]
readPrec :: ReadPrec UnOp
$creadPrec :: ReadPrec UnOp
readList :: ReadS [UnOp]
$creadList :: ReadS [UnOp]
readsPrec :: Int -> ReadS UnOp
$creadsPrec :: Int -> ReadS UnOp
Read)
data AggrOp = AggrCount | AggrSum | AggrAvg | AggrMin | AggrMax
| AggrStdDev | AggrStdDevP | AggrVar | AggrVarP
| AggrBoolOr | AggrBoolAnd | AggrArr | AggrStringAggr PrimExpr
| AggrOther String
deriving (Int -> AggrOp -> ShowS
[AggrOp] -> ShowS
AggrOp -> String
(Int -> AggrOp -> ShowS)
-> (AggrOp -> String) -> ([AggrOp] -> ShowS) -> Show AggrOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AggrOp] -> ShowS
$cshowList :: [AggrOp] -> ShowS
show :: AggrOp -> String
$cshow :: AggrOp -> String
showsPrec :: Int -> AggrOp -> ShowS
$cshowsPrec :: Int -> AggrOp -> ShowS
Show,ReadPrec [AggrOp]
ReadPrec AggrOp
Int -> ReadS AggrOp
ReadS [AggrOp]
(Int -> ReadS AggrOp)
-> ReadS [AggrOp]
-> ReadPrec AggrOp
-> ReadPrec [AggrOp]
-> Read AggrOp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AggrOp]
$creadListPrec :: ReadPrec [AggrOp]
readPrec :: ReadPrec AggrOp
$creadPrec :: ReadPrec AggrOp
readList :: ReadS [AggrOp]
$creadList :: ReadS [AggrOp]
readsPrec :: Int -> ReadS AggrOp
$creadsPrec :: Int -> ReadS AggrOp
Read)
data OrderExpr = OrderExpr OrderOp PrimExpr
deriving (Int -> OrderExpr -> ShowS
[OrderExpr] -> ShowS
OrderExpr -> String
(Int -> OrderExpr -> ShowS)
-> (OrderExpr -> String)
-> ([OrderExpr] -> ShowS)
-> Show OrderExpr
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrderExpr] -> ShowS
$cshowList :: [OrderExpr] -> ShowS
show :: OrderExpr -> String
$cshow :: OrderExpr -> String
showsPrec :: Int -> OrderExpr -> ShowS
$cshowsPrec :: Int -> OrderExpr -> ShowS
Show)
data OrderNulls = NullsFirst | NullsLast
deriving Int -> OrderNulls -> ShowS
[OrderNulls] -> ShowS
OrderNulls -> String
(Int -> OrderNulls -> ShowS)
-> (OrderNulls -> String)
-> ([OrderNulls] -> ShowS)
-> Show OrderNulls
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrderNulls] -> ShowS
$cshowList :: [OrderNulls] -> ShowS
show :: OrderNulls -> String
$cshow :: OrderNulls -> String
showsPrec :: Int -> OrderNulls -> ShowS
$cshowsPrec :: Int -> OrderNulls -> ShowS
Show
data OrderDirection = OpAsc | OpDesc
deriving Int -> OrderDirection -> ShowS
[OrderDirection] -> ShowS
OrderDirection -> String
(Int -> OrderDirection -> ShowS)
-> (OrderDirection -> String)
-> ([OrderDirection] -> ShowS)
-> Show OrderDirection
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrderDirection] -> ShowS
$cshowList :: [OrderDirection] -> ShowS
show :: OrderDirection -> String
$cshow :: OrderDirection -> String
showsPrec :: Int -> OrderDirection -> ShowS
$cshowsPrec :: Int -> OrderDirection -> ShowS
Show
data OrderOp = OrderOp { OrderOp -> OrderDirection
orderDirection :: OrderDirection
, OrderOp -> OrderNulls
orderNulls :: OrderNulls }
deriving (Int -> OrderOp -> ShowS
[OrderOp] -> ShowS
OrderOp -> String
(Int -> OrderOp -> ShowS)
-> (OrderOp -> String) -> ([OrderOp] -> ShowS) -> Show OrderOp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OrderOp] -> ShowS
$cshowList :: [OrderOp] -> ShowS
show :: OrderOp -> String
$cshow :: OrderOp -> String
showsPrec :: Int -> OrderOp -> ShowS
$cshowsPrec :: Int -> OrderOp -> ShowS
Show)