Copyright | (c) Eitan Chatav 2019 |
---|---|
Maintainer | eitan@morphism.tech |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
from clauses
Synopsis
- newtype FromClause (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType) = UnsafeFromClause {}
- table :: (Has sch db schema, Has tab schema ('Table table)) => Aliased (QualifiedAlias sch) (alias ::: tab) -> FromClause lat with db params '[alias ::: TableToRow table]
- subquery :: Aliased (Query lat with db params) query -> FromClause lat with db params '[query]
- view :: (Has sch db schema, Has vw schema ('View view)) => Aliased (QualifiedAlias sch) (alias ::: vw) -> FromClause lat with db params '[alias ::: view]
- common :: Has cte with common => Aliased Alias (alias ::: cte) -> FromClause lat with db params '[alias ::: common]
From Clause
newtype FromClause (lat :: FromType) (with :: FromType) (db :: SchemasType) (params :: [NullType]) (from :: FromType) Source #
A FromClause
can be a table name, or a derived table such
as a subquery, a JOIN
construct, or complex combinations of these.
Instances
Additional (FromClause lat with db params :: FromType -> Type) Source # | |
Defined in Squeal.PostgreSQL.Query.From also :: forall (ys :: [a]) (xs :: [a]). FromClause lat with db params ys -> FromClause lat with db params xs -> FromClause lat with db params (Join xs ys) Source # | |
Eq (FromClause lat with db params from) Source # | |
Defined in Squeal.PostgreSQL.Query.From (==) :: FromClause lat with db params from -> FromClause lat with db params from -> Bool # (/=) :: FromClause lat with db params from -> FromClause lat with db params from -> Bool # | |
Ord (FromClause lat with db params from) Source # | |
Defined in Squeal.PostgreSQL.Query.From compare :: FromClause lat with db params from -> FromClause lat with db params from -> Ordering # (<) :: FromClause lat with db params from -> FromClause lat with db params from -> Bool # (<=) :: FromClause lat with db params from -> FromClause lat with db params from -> Bool # (>) :: FromClause lat with db params from -> FromClause lat with db params from -> Bool # (>=) :: FromClause lat with db params from -> FromClause lat with db params from -> Bool # max :: FromClause lat with db params from -> FromClause lat with db params from -> FromClause lat with db params from # min :: FromClause lat with db params from -> FromClause lat with db params from -> FromClause lat with db params from # | |
Show (FromClause lat with db params from) Source # | |
Defined in Squeal.PostgreSQL.Query.From showsPrec :: Int -> FromClause lat with db params from -> ShowS # show :: FromClause lat with db params from -> String # showList :: [FromClause lat with db params from] -> ShowS # | |
Generic (FromClause lat with db params from) Source # | |
Defined in Squeal.PostgreSQL.Query.From type Rep (FromClause lat with db params from) :: Type -> Type # from :: FromClause lat with db params from -> Rep (FromClause lat with db params from) x # to :: Rep (FromClause lat with db params from) x -> FromClause lat with db params from # | |
NFData (FromClause lat with db params from) Source # | |
Defined in Squeal.PostgreSQL.Query.From rnf :: FromClause lat with db params from -> () # | |
RenderSQL (FromClause lat with db params from) Source # | |
Defined in Squeal.PostgreSQL.Query.From renderSQL :: FromClause lat with db params from -> ByteString Source # | |
type Rep (FromClause lat with db params from) Source # | |
Defined in Squeal.PostgreSQL.Query.From type Rep (FromClause lat with db params from) = D1 ('MetaData "FromClause" "Squeal.PostgreSQL.Query.From" "squeal-postgresql-0.9.0.0-D17NIjlcsGRAwJTaCTXyvM" 'True) (C1 ('MetaCons "UnsafeFromClause" 'PrefixI 'True) (S1 ('MetaSel ('Just "renderFromClause") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) |
:: (Has sch db schema, Has tab schema ('Table table)) | |
=> Aliased (QualifiedAlias sch) (alias ::: tab) | (renamable) table alias |
-> FromClause lat with db params '[alias ::: TableToRow table] |
A real table
is a table from the database.
:: Aliased (Query lat with db params) query | aliased |
-> FromClause lat with db params '[query] |
subquery
derives a table from a Query
.
The subquery may not reference columns provided by preceding FromClause
items.
Use JoinLateral
if the subquery must reference columns provided by preceding FromClause
items.
:: (Has sch db schema, Has vw schema ('View view)) | |
=> Aliased (QualifiedAlias sch) (alias ::: vw) | (renamable) view alias |
-> FromClause lat with db params '[alias ::: view] |