sqel-0.0.1.0: Guided derivation for Hasql statements
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sqel.Data.Dd

Documentation

data ProductField Source #

Constructors

ProductField 

Fields

Instances

Instances details
CompColumn' meta ('Right 'SpecNP :: Either Void SpecType) ('[] :: [ProductField]) a (NP f ('[] :: [k])) ('[] :: [DdK]) Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: NP f '[] -> NP Dd '[] Source #

CheckCompItem meta field arg s => CompColumn' meta ('Right 'SpecDsl :: Either Void SpecType) '[field] a arg '[s] Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: arg -> NP Dd '[s] Source #

(CheckCompItem meta field arg0 s0, CompColumn' (MetaNext meta) ('Right 'SpecDsl :: Either Void SpecType) fields a args s1) => CompColumn' meta ('Right 'SpecDsl :: Either Void SpecType) (field ': fields) a (arg0 :> args) (s0 ': s1) Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: (arg0 :> args) -> NP Dd (s0 ': s1) Source #

(CheckCompItem meta field (f arg0) s0, CompColumn' (MetaNext meta) ('Right 'SpecNP :: Either Void SpecType) fields a2 (NP f args) s1) => CompColumn' meta ('Right 'SpecNP :: Either Void SpecType) (field ': fields) a2 (NP f (arg0 ': args)) (s0 ': s1) Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: NP f (arg0 ': args) -> NP Dd (s0 ': s1) Source #

newtype ConCol (name :: Symbol) (record :: Bool) (fields :: [ProductField]) as Source #

Constructors

ConCol 

Fields

Instances

Instances details
(a ~ ConCol name record fields as, TypeName 'DefaultPrefix name tname, meta ~ MetaFor "constructor" ('Text name) "con1", CompColumn meta (Con1Fields a) a arg s) => Con1Column a arg ('DdK 'SelAuto (NoMods :: [Type]) (ConCol name record fields as) ('Comp ('TSel 'DefaultPrefix name) ('Prod ('Con as)) 'Merge s)) Source # 
Instance details

Defined in Sqel.Sum

Methods

con1 :: arg -> Dd ('DdK 'SelAuto NoMods (ConCol name record fields as) ('Comp ('TSel 'DefaultPrefix name) ('Prod ('Con as)) 'Merge s)) Source #

(a ~ ConCol name record fields as, MkTSel ('TSel 'DefaultPrefix name), meta ~ MetaFor "constructor" ('Text name) "con", CompColumn meta fields a arg s) => ConColumn a arg ('DdK 'SelAuto (NoMods :: [Type]) (ConCol name record fields as) ('Comp ('TSel 'DefaultPrefix name) ('Prod ('Con as)) 'Nest s)) Source # 
Instance details

Defined in Sqel.Sum

Methods

con :: arg -> Dd ('DdK 'SelAuto NoMods (ConCol name record fields as) ('Comp ('TSel 'DefaultPrefix name) ('Prod ('Con as)) 'Nest s)) Source #

(Invariant b, WrapConB b ass as) => WrapConB b (as' ': ass) (ConCol name record fields as' ': as) Source # 
Instance details

Defined in Sqel.Codec.Sum

Methods

wrapConB :: NP b (ConCol name record fields as' ': as) -> NP (ConB b) (as' ': ass) Source #

ConCodec b as => CompCodec ('Prod ('Con as)) i (ConCol name record fields as) b as Source # 
Instance details

Defined in Sqel.ReifyCodec

Methods

compCodec :: NP b as -> b (ConCol name record fields as) Source #

data ProdType Source #

Constructors

Reg 
Con [Type] 

data Comp Source #

Constructors

Prod ProdType 
Sum 

Instances

Instances details
DefaultCompCodec c i b a as => ReifyCompCodec (b :: Type -> Type) (c :: Comp) (i :: CompInc) ps (as :: [Type]) (a :: Type) Source # 
Instance details

Defined in Sqel.ReifyCodec

Methods

reifyCompCodec :: NP I ps -> NP b as -> b a Source #

data CompInc Source #

Constructors

Merge 
Nest 

Instances

Instances details
DefaultCompCodec c i b a as => ReifyCompCodec (b :: Type -> Type) (c :: Comp) (i :: CompInc) ps (as :: [Type]) (a :: Type) Source # 
Instance details

Defined in Sqel.ReifyCodec

Methods

reifyCompCodec :: NP I ps -> NP b as -> b a Source #

data Struct Source #

Constructors

Prim 
Comp 

Fields

data DdK Source #

Constructors

DdK 

Fields

Instances

Instances details
(b ~ a, CompName a ('TSel prefix name), fields ~ SumFields (GDatatypeInfoOf a) (GCode a), meta ~ MetaFor "sum type" ('ShowType a) "sum", CompColumn meta fields a arg s) => SumWith b isel imods arg ('DdK 'SelAuto (NoMods :: [Type]) a ('Comp ('TSel prefix name) 'Sum 'Nest ('DdK isel imods Int64 'Prim ': s))) Source # 
Instance details

Defined in Sqel.Sum

Methods

sumWith :: Dd ('DdK isel imods Int64 'Prim) -> arg -> Dd ('DdK 'SelAuto NoMods a ('Comp ('TSel prefix name) 'Sum 'Nest ('DdK isel imods Int64 'Prim ': s))) Source #

(b ~ a, CompName a ('TSel prefix name), IndexName 'DefaultPrefix name iname, fields ~ SumFields (GDatatypeInfoOf a) (GCode a), meta ~ MetaFor "sum type" ('ShowType a) "sum", CompColumn meta fields a arg s) => Sum b arg ('DdK 'SelAuto (NoMods :: [Type]) a ('Comp ('TSel prefix name) 'Sum 'Nest (IndexColumn name ': s))) Source # 
Instance details

Defined in Sqel.Sum

Methods

sum :: arg -> Dd ('DdK 'SelAuto NoMods a ('Comp ('TSel prefix name) 'Sum 'Nest (IndexColumn name ': s))) Source #

ReifyCodecComp b ('[] :: [DdK]) ('[] :: [Type]) Source # 
Instance details

Defined in Sqel.ReifyCodec

Methods

reifyCodecComp :: NP Dd '[] -> NP b '[] Source #

CompColumn' meta ('Right 'SpecNP :: Either Void SpecType) ('[] :: [ProductField]) a (NP f ('[] :: [k])) ('[] :: [DdK]) Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: NP f '[] -> NP Dd '[] Source #

(ReifyCodec b s a, ReifyCodecComp b ss as) => ReifyCodecComp b (s ': ss) (a ': as) Source # 
Instance details

Defined in Sqel.ReifyCodec

Methods

reifyCodecComp :: NP Dd (s ': ss) -> NP b (a ': as) Source #

CheckCompItem meta field arg s => CompColumn' meta ('Right 'SpecDsl :: Either Void SpecType) '[field] a arg '[s] Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: arg -> NP Dd '[s] Source #

(CheckCompItem meta field arg0 s0, CompColumn' (MetaNext meta) ('Right 'SpecDsl :: Either Void SpecType) fields a args s1) => CompColumn' meta ('Right 'SpecDsl :: Either Void SpecType) (field ': fields) a (arg0 :> args) (s0 ': s1) Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: (arg0 :> args) -> NP Dd (s0 ': s1) Source #

(CheckCompItem meta field (f arg0) s0, CompColumn' (MetaNext meta) ('Right 'SpecNP :: Either Void SpecType) fields a2 (NP f args) s1) => CompColumn' meta ('Right 'SpecNP :: Either Void SpecType) (field ': fields) a2 (NP f (arg0 ': args)) (s0 ': s1) Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: NP f (arg0 ': args) -> NP Dd (s0 ': s1) Source #

IndexName ('SelPrefix prefix) tpe iname => SetIndexPrefix prefix ('DdK sel mods a ('Comp tsel 'Sum i ('DdK ('SelIndex oldPrefix tpe) (NoMods :: [Type]) Int64 'Prim ': cons))) ('DdK sel mods a ('Comp tsel 'Sum i (IndexColumnWith ('SelPrefix prefix) tpe ': cons))) Source # 
Instance details

Defined in Sqel.Sum

Methods

setIndexPrefix :: Dd ('DdK sel mods a ('Comp tsel 'Sum i ('DdK ('SelIndex oldPrefix tpe) NoMods Int64 'Prim ': cons))) -> Dd ('DdK sel mods a ('Comp tsel 'Sum i (IndexColumnWith ('SelPrefix prefix) tpe ': cons))) Source #

PrettyNP ('[] :: [DdK]) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

prettyNP :: NP Dd '[] -> [Doc ann] Source #

ReifyDdComp ('[] :: [DdK]) Source # 
Instance details

Defined in Sqel.ReifyDd

Methods

reifyDdComp :: NP Dd '[] -> [DdTerm] Source #

DdCols ('[] :: [DdK]) ('[] :: [DdlColumnK]) ('[] :: [DdlTypeK]) Source # 
Instance details

Defined in Sqel.Migration.Ddl

Methods

ddCols :: NP Dd '[] -> (NP DdlColumn '[], NP DdlType '[]) Source #

MkPrimNewtypes ('[] :: [k]) ('[] :: [DdK]) Source # 
Instance details

Defined in Sqel.Prim

Methods

mkPrimNewtypes :: NP Dd '[] Source #

MkPrims ('[] :: [k]) ('[] :: [DdK]) Source # 
Instance details

Defined in Sqel.Prim

Methods

mkPrims :: NP Dd '[] Source #

(MkPrimNewtypes as s, err ~ NewtypeError, UnwrapNewtype err a w) => MkPrimNewtypes (a ': as :: [Type]) ('DdK 'SelAuto '[Newtype a w] a 'Prim ': s) Source # 
Instance details

Defined in Sqel.Prim

Methods

mkPrimNewtypes :: NP Dd ('DdK 'SelAuto '[Newtype a w] a 'Prim ': s) Source #

MkPrims as s => MkPrims (a ': as :: [Type]) ('DdK 'SelAuto ('[] :: [Type]) a 'Prim ': s) Source # 
Instance details

Defined in Sqel.Prim

Methods

mkPrims :: NP Dd ('DdK 'SelAuto '[] a 'Prim ': s) Source #

(Pretty (Dd s), PrettyNP ss) => PrettyNP (s ': ss) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

prettyNP :: NP Dd (s ': ss) -> [Doc ann] Source #

(ReifyDd s, ReifyDdComp ss) => ReifyDdComp (s ': ss) Source # 
Instance details

Defined in Sqel.ReifyDd

Methods

reifyDdComp :: NP Dd (s ': ss) -> [DdTerm] Source #

(DdCols sub mergeCols subTypes, DdCols ss cols types, allCols ~ (mergeCols ++ cols), allTypes ~ (subTypes ++ types)) => DdCols ('DdK sel mods a ('Comp ('TSel tprefix tname) c 'Merge sub) ': ss) allCols allTypes Source # 
Instance details

Defined in Sqel.Migration.Ddl

Methods

ddCols :: NP Dd ('DdK sel mods a ('Comp ('TSel tprefix tname) c 'Merge sub) ': ss) -> (NP DdlColumn allCols, NP DdlType allTypes) Source #

(ColumnConstraints mods, DdlTypes 'False ('DdK ('SelSymbol name) mods a ('Comp ('TSel tprefix tname) c 'Nest sub)) hTypes, DdCols ss cols types, allTypes ~ (hTypes ++ types), rename ~ MigrationRenameK mods, renameType ~ MigrationRenameTypeK mods, delete ~ MigrationDeleteK mods, TypeName tprefix tname pgName) => DdCols ('DdK ('SelSymbol name) mods a ('Comp ('TSel tprefix tname) c 'Nest sub) ': ss) ('DdlColumnK name ('Just pgName) mods rename renameType delete a ': cols) allTypes Source # 
Instance details

Defined in Sqel.Migration.Ddl

Methods

ddCols :: NP Dd ('DdK ('SelSymbol name) mods a ('Comp ('TSel tprefix tname) c 'Nest sub) ': ss) -> (NP DdlColumn ('DdlColumnK name ('Just pgName) mods rename renameType delete a ': cols), NP DdlType allTypes) Source #

(ReifySel sel name, ReifyPrimName a mods, ColumnConstraints mods, DdCols ss cols types, rename ~ MigrationRenameK mods, renameType ~ MigrationRenameTypeK mods, delete ~ MigrationDeleteK mods) => DdCols ('DdK sel mods a 'Prim ': ss) ('DdlColumnK name ('Nothing :: Maybe Symbol) mods rename renameType delete a ': cols) types Source # 
Instance details

Defined in Sqel.Migration.Ddl

Methods

ddCols :: NP Dd ('DdK sel mods a 'Prim ': ss) -> (NP DdlColumn ('DdlColumnK name 'Nothing mods rename renameType delete a ': cols), NP DdlType types) Source #

(All ToSelectExpr sub, QFragmentPrefix sel) => ToSelectExpr ('DdK sel p q ('Comp tsel 'Sum 'Nest (IndexColumn name ': sub))) Source # 
Instance details

Defined in Sqel.Query.SelectExpr

Methods

toSelectExpr :: ColumnPrefix -> Dd ('DdK sel p q ('Comp tsel 'Sum 'Nest (IndexColumn name ': sub))) -> SelectExpr Source #

type a > (b :: DdK) Source # 
Instance details

Defined in Sqel.Type

type a > (b :: DdK) = '[a, b]
type ('DdK sel mods a ('Comp tsel c i ('[] :: [DdK]))) *> (sub :: DdK) Source # 
Instance details

Defined in Sqel.Type

type ('DdK sel mods a ('Comp tsel c i ('[] :: [DdK]))) *> (sub :: DdK) = 'DdK sel mods a ('Comp tsel c i '[sub])
type a > (b :: [DdK]) Source # 
Instance details

Defined in Sqel.Type

type a > (b :: [DdK]) = a ': b
type ('DdK sel mods a ('Comp tsel c i ('[] :: [DdK]))) *> (sub :: [DdK]) Source # 
Instance details

Defined in Sqel.Type

type ('DdK sel mods a ('Comp tsel c i ('[] :: [DdK]))) *> (sub :: [DdK]) = 'DdK sel mods a ('Comp tsel c i sub)

data DdSort c where Source #

Constructors

DdProd :: DdSort ('Prod 'Reg) 
DdCon :: DdSort ('Prod ('Con as)) 
DdSum :: DdSort 'Sum 

class MkDdSort c where Source #

Methods

ddSort :: DdSort c Source #

Instances

Instances details
MkDdSort 'Sum Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

ddSort :: DdSort 'Sum Source #

MkDdSort ('Prod ('Con as)) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

ddSort :: DdSort ('Prod ('Con as)) Source #

MkDdSort ('Prod 'Reg) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

ddSort :: DdSort ('Prod 'Reg) Source #

data DdInc c where Source #

Constructors

DdMerge :: DdInc 'Merge 
DdNest :: DdInc 'Nest 

class MkDdInc c where Source #

Methods

ddInc :: DdInc c Source #

Instances

Instances details
MkDdInc 'Merge Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

ddInc :: DdInc 'Merge Source #

MkDdInc 'Nest Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

ddInc :: DdInc 'Nest Source #

data DdStruct s where Source #

Constructors

DdPrim :: DdStruct 'Prim 
DdComp :: TSelW sel -> DdSort c -> DdInc i -> NP Dd sub -> DdStruct ('Comp sel c i sub) 

Instances

Instances details
Pretty (DdStruct 'Prim) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

pretty :: DdStruct 'Prim -> Doc ann #

prettyList :: [DdStruct 'Prim] -> Doc ann #

data Dd s where Source #

Constructors

Dd :: SelW sel -> Mods mods -> DdStruct s -> Dd ('DdK sel mods a s) 

Instances

Instances details
Column a fieldName s0 s1 => CompItemOrError err ('ProductField fieldName a) (Dd s0) s1 Source # 
Instance details

Defined in Sqel.Comp

Methods

compItemOrError :: Proxy err -> Dd s0 -> Dd s1 Source #

PrettyNP sub => Pretty (Dd ('DdK sel p a ('Comp tsel c i sub))) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

pretty :: Dd ('DdK sel p a ('Comp tsel c i sub)) -> Doc ann #

prettyList :: [Dd ('DdK sel p a ('Comp tsel c i sub))] -> Doc ann #

Pretty (Mods p) => Pretty (Dd ('DdK sel p a 'Prim)) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

pretty :: Dd ('DdK sel p a 'Prim) -> Doc ann #

prettyList :: [Dd ('DdK sel p a 'Prim)] -> Doc ann #

data QOp Source #

Constructors

QAnd 
QOr 

Instances

Instances details
Generic QOp Source # 
Instance details

Defined in Sqel.Data.Dd

Associated Types

type Rep QOp :: Type -> Type #

Methods

from :: QOp -> Rep QOp x #

to :: Rep QOp x -> QOp #

Show QOp Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

showsPrec :: Int -> QOp -> ShowS #

show :: QOp -> String #

showList :: [QOp] -> ShowS #

Eq QOp Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

(==) :: QOp -> QOp -> Bool #

(/=) :: QOp -> QOp -> Bool #

type Rep QOp Source # 
Instance details

Defined in Sqel.Data.Dd

type Rep QOp = D1 ('MetaData "QOp" "Sqel.Data.Dd" "sqel-0.0.1.0-5k4czMecwS553bFrfF1Jzu" 'False) (C1 ('MetaCons "QAnd" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "QOr" 'PrefixI 'False) (U1 :: Type -> Type))

type family DdType s where ... Source #

Equations

DdType ('DdK _ _ a _) = a 

type family DdTypes s where ... Source #

Equations

DdTypes '[] = '[] 
DdTypes (s ': ss) = DdType s ': DdTypes ss 

type family DdSel s where ... Source #

Equations

DdSel ('DdK sel _ _ _) = sel 

type family DdName (s :: DdK) :: Symbol where ... Source #

Equations

DdName ('DdK ('SelSymbol name) _ _ _) = name 
DdName ('DdK _ _ a _) = TypeError (("This Dd for type " <> a) <> " has no name") 

type family DdTypeSel s where ... Source #

Equations

DdTypeSel ('DdK _ _ _ ('Comp sel _ _ _)) = sel 

sel :: Dd s -> SelW (DdSel s) Source #

typeSel :: Dd ('DdK sel p a ('Comp tsel c i sub)) -> TSelW tsel Source #

showTypeSel :: Dd ('DdK sel p a ('Comp tsel c i sub)) -> Text Source #

data a :> b infixr 3 Source #

Constructors

a :> b infixr 3 

Instances

Instances details
(CheckCompItem meta field arg0 s0, CompColumn' (MetaNext meta) ('Right 'SpecDsl :: Either Void SpecType) fields a args s1) => CompColumn' meta ('Right 'SpecDsl :: Either Void SpecType) (field ': fields) a (arg0 :> args) (s0 ': s1) Source # 
Instance details

Defined in Sqel.Comp

Methods

compColumn' :: (arg0 :> args) -> NP Dd (s0 ': s1) Source #

SymNP p1 ps => SymNP (p0 :> p1) (p0 ': ps) Source # 
Instance details

Defined in Sqel.Class.Mods

Methods

symNP :: (p0 :> p1) -> NP I (p0 ': ps) Source #

MkMigrations old (mig1 ': migs) => MkMigrations (Migration ('Mig from to m ext) :> old) ('Mig from to m ext ': (mig1 ': migs)) Source # 
Instance details

Defined in Sqel.Data.Migration

Methods

mkMigrations :: (Migration ('Mig from to m ext) :> old) -> NP Migration ('Mig from to m ext ': (mig1 ': migs)) Source #

class PrettyNP s where Source #

Methods

prettyNP :: NP Dd s -> [Doc ann] Source #

Instances

Instances details
PrettyNP ('[] :: [DdK]) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

prettyNP :: NP Dd '[] -> [Doc ann] Source #

(Pretty (Dd s), PrettyNP ss) => PrettyNP (s ': ss) Source # 
Instance details

Defined in Sqel.Data.Dd

Methods

prettyNP :: NP Dd (s ': ss) -> [Doc ann] Source #

type family Sqel' sel mods a s = r | r -> sel mods a s where ... Source #

Equations

Sqel' sel mods a s = Dd ('DdK sel mods a s) 

type family Sqel a p = r | r -> p a where ... Source #

Equations

Sqel a '(sel, mods, s) = Dd ('DdK sel mods a s)