Safe Haskell | None |
---|---|
Language | Haskell2010 |
This modules defines the tree of Select types: how we represent a query internally, from its top
level QueryDB
down to each individual field. Most of those types have three type arguments:
b: BackendType The backend that is targeted by that specific select (Postgres Vanilla, MSSQL...); we use the type families in the Backend class to decide how different parts of the IR are represented in different backends.
v: Type
The type of the leaf values in our AST; used almost exclusively for column values, over which
queries can be parameterized. The output of the parser phase will use UnpreparedValue b
for
the leaves, and most backends will then transform the AST to interpret those values and
consequently change v
to be SQLExpression b
r: BackendType -> Type
Joins across backends mean that the aforementioned b
parameter won't be the same throughout
the entire tree; at some point we will have an AnyBackend
used to encapsulate a branch that
uses a different b
. We still want, however, to be able to parameterize the values of the
leaves in that separate branch, and that's what the r
parameter is for. We also use
UnpreparedValue
here during the parsing phase, meaning all leaf values will be
UnpreparedValue b
for their respective backend b
, and most backends will then transform
their AST, cutting all such remote branches, and therefore using Const Void
for r
.
Synopsis
- data QueryDB (b :: BackendType) (r :: Type) v
- = QDBMultipleRows (AnnSimpleSelectG b r v)
- | QDBSingleRow (AnnSimpleSelectG b r v)
- | QDBAggregation (AnnAggregateSelectG b r v)
- | QDBConnection (ConnectionSelect b r v)
- | QDBStreamMultipleRows (AnnSimpleStreamSelectG b r v)
- data AnnSelectG (b :: BackendType) (f :: Type -> Type) (v :: Type) = AnnSelectG {
- _asnFields :: Fields (f v)
- _asnFrom :: SelectFromG b v
- _asnPerm :: TablePermG b v
- _asnArgs :: SelectArgsG b v
- _asnStrfyNum :: StringifyNumbers
- _asnNamingConvention :: Maybe NamingCase
- data AnnSelectStreamG (b :: BackendType) (f :: Type -> Type) (v :: Type) = AnnSelectStreamG {
- _assnXStreamingSubscription :: XStreamingSubscription b
- _assnFields :: Fields (f v)
- _assnFrom :: SelectFromG b v
- _assnPerm :: TablePermG b v
- _assnArgs :: SelectStreamArgsG b v
- _assnStrfyNum :: StringifyNumbers
- type AnnSimpleSelectG b r v = AnnSelectG b (AnnFieldG b r) v
- type AnnAggregateSelectG b r v = AnnSelectG b (TableAggregateFieldG b r) v
- type AnnSimpleStreamSelectG b r v = AnnSelectStreamG b (AnnFieldG b r) v
- type AnnSimpleSelect b = AnnSimpleSelectG b Void (SQLExpression b)
- type AnnAggregateSelect b = AnnAggregateSelectG b Void (SQLExpression b)
- type AnnSimpleStreamSelect b = AnnSimpleStreamSelectG b Void (SQLExpression b)
- bifoldMapAnnSelectG :: (Backend b, Bifoldable (f b), Monoid m) => (r -> m) -> (v -> m) -> AnnSelectG b (f b r) v -> m
- bifoldMapAnnSelectStreamG :: (Backend b, Bifoldable (f b), Monoid m) => (r -> m) -> (v -> m) -> AnnSelectStreamG b (f b r) v -> m
- data ConnectionSelect (b :: BackendType) (r :: Type) v = ConnectionSelect {
- _csXRelay :: XRelay b
- _csPrimaryKeyColumns :: PrimaryKeyColumns b
- _csSplit :: Maybe (NonEmpty (ConnectionSplit b v))
- _csSlice :: Maybe ConnectionSlice
- _csSelect :: AnnSelectG b (ConnectionField b r) v
- data ConnectionSplit (b :: BackendType) v = ConnectionSplit {
- _csKind :: ConnectionSplitKind
- _csValue :: v
- _csOrderBy :: OrderByItemG b (AnnotatedOrderByElement b v)
- data ConnectionSlice
- data ConnectionSplitKind
- newtype FIIdentifier = FIIdentifier {
- unFIIdentifier :: Text
- data SelectFromG (b :: BackendType) v
- = FromTable (TableName b)
- | FromIdentifier FIIdentifier
- | FromFunction (FunctionName b) (FunctionArgsExp b v) (Maybe [(Column b, ScalarType b)])
- type SelectFrom b = SelectFromG b (SQLExpression b)
- data SelectStreamArgsG (b :: BackendType) v = SelectStreamArgsG {
- _ssaWhere :: Maybe (AnnBoolExp b v)
- _ssaBatchSize :: Int
- _ssaCursorArg :: StreamCursorItem b
- type SelectStreamArgs b = SelectStreamArgsG b (SQLExpression b)
- data SelectArgsG (b :: BackendType) v = SelectArgs {
- _saWhere :: Maybe (AnnBoolExp b v)
- _saOrderBy :: Maybe (NonEmpty (AnnotatedOrderByItemG b v))
- _saLimit :: Maybe Int
- _saOffset :: Maybe Int64
- _saDistinct :: Maybe (NonEmpty (Column b))
- type SelectArgs b = SelectArgsG b (SQLExpression b)
- noSelectArgs :: SelectArgsG backend v
- data ComputedFieldOrderByElement (b :: BackendType) v
- = CFOBEScalar (ScalarType b)
- | CFOBETableAggregation (TableName b) (AnnBoolExp b v) (AnnotatedAggregateOrderBy b)
- data ComputedFieldOrderBy (b :: BackendType) v = ComputedFieldOrderBy {}
- data AnnotatedOrderByElement (b :: BackendType) v
- = AOCColumn (ColumnInfo b)
- | AOCObjectRelation (RelInfo b) (AnnBoolExp b v) (AnnotatedOrderByElement b v)
- | AOCArrayAggregation (RelInfo b) (AnnBoolExp b v) (AnnotatedAggregateOrderBy b)
- | AOCComputedField (ComputedFieldOrderBy b v)
- data AnnotatedAggregateOrderBy (b :: BackendType)
- = AAOCount
- | AAOOp Text (ColumnInfo b)
- type AnnotatedOrderByItemG b v = OrderByItemG b (AnnotatedOrderByElement b v)
- type AnnotatedOrderByItem b = AnnotatedOrderByItemG b (SQLExpression b)
- data StreamCursorItem (b :: BackendType) = StreamCursorItem {}
- data RemoteRelationshipSelect b r = RemoteRelationshipSelect {
- _rrsLHSJoinFields :: HashMap FieldName (DBJoinField b)
- _rrsRelationship :: r
- data AnnFieldG (b :: BackendType) (r :: Type) v
- = AFColumn (AnnColumnField b v)
- | AFObjectRelation (ObjectRelationSelectG b r v)
- | AFArrayRelation (ArraySelectG b r v)
- | AFComputedField (XComputedField b) ComputedFieldName (ComputedFieldSelect b r v)
- | AFRemote (RemoteRelationshipSelect b r)
- | AFNodeId (XRelay b) SourceName (TableName b) (PrimaryKeyColumns b)
- | AFExpression Text
- type AnnField b = AnnFieldG b Void (SQLExpression b)
- type AnnFields b = AnnFieldsG b Void (SQLExpression b)
- mkAnnColumnField :: Column backend -> ColumnType backend -> Maybe (AnnColumnCaseBoolExp backend v) -> Maybe (ScalarSelectionArguments backend) -> AnnFieldG backend r v
- mkAnnColumnFieldAsText :: ColumnInfo backend -> AnnFieldG backend r v
- traverseSourceRelationshipSelection :: (Applicative f, Backend backend) => (vf backend -> f (vg backend)) -> SourceRelationshipSelection backend r vf -> f (SourceRelationshipSelection backend r vg)
- data TableAggregateFieldG (b :: BackendType) (r :: Type) v
- = TAFAgg (AggregateFields b)
- | TAFNodes (XNodesAgg b) (AnnFieldsG b r v)
- | TAFExp Text
- data AggregateField (b :: BackendType)
- = AFCount (CountType b)
- | AFOp (AggregateOp b)
- | AFExp Text
- data AggregateOp (b :: BackendType) = AggregateOp {
- _aoOp :: Text
- _aoFields :: ColumnFields b
- data ColFld (b :: BackendType)
- = CFCol (Column b) (ColumnType b)
- | CFExp Text
- type TableAggregateField b = TableAggregateFieldG b Void (SQLExpression b)
- type TableAggregateFields b = TableAggregateFieldsG b Void (SQLExpression b)
- type TableAggregateFieldsG b r v = Fields (TableAggregateFieldG b r v)
- type ColumnFields b = Fields (ColFld b)
- type AggregateFields b = Fields (AggregateField b)
- type AnnFieldsG b r v = Fields (AnnFieldG b r v)
- data ConnectionField (b :: BackendType) (r :: Type) v
- = ConnectionTypename Text
- | ConnectionPageInfo PageInfoFields
- | ConnectionEdges (EdgeFields b r v)
- data PageInfoField
- data EdgeField (b :: BackendType) (r :: Type) v
- = EdgeTypename Text
- | EdgeCursor
- | EdgeNode (AnnFieldsG b r v)
- type ConnectionFields b r v = Fields (ConnectionField b r v)
- type PageInfoFields = Fields PageInfoField
- type EdgeFields b r v = Fields (EdgeField b r v)
- data AnnColumnField (b :: BackendType) v = AnnColumnField {
- _acfColumn :: Column b
- _acfType :: ColumnType b
- _acfAsText :: Bool
- _acfArguments :: Maybe (ScalarSelectionArguments b)
- _acfCaseBoolExpression :: Maybe (AnnColumnCaseBoolExp b v)
- data ComputedFieldScalarSelect (b :: BackendType) v = ComputedFieldScalarSelect {}
- data ComputedFieldSelect (b :: BackendType) (r :: Type) v
- = CFSScalar (ComputedFieldScalarSelect b v) (Maybe (AnnColumnCaseBoolExp b v))
- | CFSTable JsonAggSelect (AnnSimpleSelectG b r v)
- data AnnRelationSelectG (b :: BackendType) a = AnnRelationSelectG {
- _aarRelationshipName :: RelName
- _aarColumnMapping :: HashMap (Column b) (Column b)
- _aarAnnSelect :: a
- type ArrayRelationSelectG b r v = AnnRelationSelectG b (AnnSimpleSelectG b r v)
- type ArrayAggregateSelectG b r v = AnnRelationSelectG b (AnnAggregateSelectG b r v)
- type ArrayConnectionSelect b r v = AnnRelationSelectG b (ConnectionSelect b r v)
- type ArrayAggregateSelect b = ArrayAggregateSelectG b Void (SQLExpression b)
- data AnnObjectSelectG (b :: BackendType) (r :: Type) v = AnnObjectSelectG {
- _aosFields :: AnnFieldsG b r v
- _aosTableFrom :: TableName b
- _aosTableFilter :: AnnBoolExp b v
- type AnnObjectSelect b r = AnnObjectSelectG b r (SQLExpression b)
- type ObjectRelationSelectG b r v = AnnRelationSelectG b (AnnObjectSelectG b r v)
- type ObjectRelationSelect b = ObjectRelationSelectG b Void (SQLExpression b)
- data ArraySelectG (b :: BackendType) (r :: Type) v
- = ASSimple (ArrayRelationSelectG b r v)
- | ASAggregate (ArrayAggregateSelectG b r v)
- | ASConnection (ArrayConnectionSelect b r v)
- type ArraySelect b = ArraySelectG b Void (SQLExpression b)
- type ArraySelectFieldsG b r v = Fields (ArraySelectG b r v)
- data SourceRelationshipSelection (b :: BackendType) (r :: Type) (vf :: BackendType -> Type)
- = SourceRelationshipObject (AnnObjectSelectG b r (vf b))
- | SourceRelationshipArray (AnnSimpleSelectG b r (vf b))
- | SourceRelationshipArrayAggregate (AnnAggregateSelectG b r (vf b))
- data RemoteSourceSelect (r :: Type) (vf :: BackendType -> Type) (tgt :: BackendType) = RemoteSourceSelect {
- _rssName :: SourceName
- _rssConfig :: SourceConfig tgt
- _rssSelection :: SourceRelationshipSelection tgt r vf
- _rssJoinMapping :: HashMap FieldName (ScalarType tgt, Column tgt)
- data TablePermG (b :: BackendType) v = TablePerm {
- _tpFilter :: AnnBoolExp b v
- _tpLimit :: Maybe Int
- type TablePerm b = TablePermG b (SQLExpression b)
- noTablePermissions :: TablePermG backend v
- insertFunctionArg :: FunctionArgName -> Int -> a -> FunctionArgsExpG a -> FunctionArgsExpG a
- data CountDistinct
- asnStrfyNum :: forall b f v. Lens' (AnnSelectG b f v) StringifyNumbers
- asnPerm :: forall b f v. Lens' (AnnSelectG b f v) (TablePermG b v)
- asnNamingConvention :: forall b f v. Lens' (AnnSelectG b f v) (Maybe NamingCase)
- asnFrom :: forall b f v. Lens' (AnnSelectG b f v) (SelectFromG b v)
- asnFields :: forall b f v f. Lens (AnnSelectG b f v) (AnnSelectG b f v) (Fields (f v)) (Fields (f v))
- asnArgs :: forall b f v. Lens' (AnnSelectG b f v) (SelectArgsG b v)
- aosTableFrom :: forall b r v. Lens' (AnnObjectSelectG b r v) (TableName b)
- aosTableFilter :: forall b r v. Lens' (AnnObjectSelectG b r v) (AnnBoolExp b v)
- aosFields :: forall b r v r. Lens (AnnObjectSelectG b r v) (AnnObjectSelectG b r v) (AnnFieldsG b r v) (AnnFieldsG b r v)
- aarRelationshipName :: forall b a. Lens' (AnnRelationSelectG b a) RelName
- aarColumnMapping :: forall b a b. Lens (AnnRelationSelectG b a) (AnnRelationSelectG b a) (HashMap (Column b) (Column b)) (HashMap (Column b) (Column b))
- aarAnnSelect :: forall b a a. Lens (AnnRelationSelectG b a) (AnnRelationSelectG b a) a a
- csXRelay :: forall b r v. Lens' (ConnectionSelect b r v) (XRelay b)
- csSplit :: forall b r v. Lens' (ConnectionSelect b r v) (Maybe (NonEmpty (ConnectionSplit b v)))
- csSlice :: forall b r v. Lens' (ConnectionSelect b r v) (Maybe ConnectionSlice)
- csSelect :: forall b r v r. Lens (ConnectionSelect b r v) (ConnectionSelect b r v) (AnnSelectG b (ConnectionField b r) v) (AnnSelectG b (ConnectionField b r) v)
- csPrimaryKeyColumns :: forall b r v. Lens' (ConnectionSelect b r v) (PrimaryKeyColumns b)
- saWhere :: forall b v. Lens' (SelectArgsG b v) (Maybe (AnnBoolExp b v))
- saOrderBy :: forall b v. Lens' (SelectArgsG b v) (Maybe (NonEmpty (AnnotatedOrderByItemG b v)))
- saOffset :: forall b v. Lens' (SelectArgsG b v) (Maybe Int64)
- saLimit :: forall b v. Lens' (SelectArgsG b v) (Maybe Int)
- saDistinct :: forall b v. Lens' (SelectArgsG b v) (Maybe (NonEmpty (Column b)))
- _AFExpression :: forall b r v. Prism' (AnnFieldG b r v) Text
- _AFNodeId :: forall b r v. Prism' (AnnFieldG b r v) (XRelay b, SourceName, TableName b, PrimaryKeyColumns b)
- _AFRemote :: forall b r v. Prism' (AnnFieldG b r v) (RemoteRelationshipSelect b r)
- _AFComputedField :: forall b r v. Prism' (AnnFieldG b r v) (XComputedField b, ComputedFieldName, ComputedFieldSelect b r v)
- _AFArrayRelation :: forall b r v. Prism' (AnnFieldG b r v) (ArraySelectG b r v)
- _AFObjectRelation :: forall b r v. Prism' (AnnFieldG b r v) (ObjectRelationSelectG b r v)
- _AFColumn :: forall b r v. Prism' (AnnFieldG b r v) (AnnColumnField b v)
- _AOCComputedField :: forall b v. Prism' (AnnotatedOrderByElement b v) (ComputedFieldOrderBy b v)
- _AOCArrayAggregation :: forall b v. Prism' (AnnotatedOrderByElement b v) (RelInfo b, AnnBoolExp b v, AnnotatedAggregateOrderBy b)
- _AOCObjectRelation :: forall b v. Prism' (AnnotatedOrderByElement b v) (RelInfo b, AnnBoolExp b v, AnnotatedOrderByElement b v)
- _AOCColumn :: forall b v. Prism' (AnnotatedOrderByElement b v) (ColumnInfo b)
- _TAFExp :: forall b r v. Prism' (TableAggregateFieldG b r v) Text
- _TAFNodes :: forall b r v r v. Prism (TableAggregateFieldG b r v) (TableAggregateFieldG b r v) (XNodesAgg b, AnnFieldsG b r v) (XNodesAgg b, AnnFieldsG b r v)
- _TAFAgg :: forall b r v. Prism' (TableAggregateFieldG b r v) (AggregateFields b)
- _ConnectionEdges :: forall b r v b r v. Prism (ConnectionField b r v) (ConnectionField b r v) (EdgeFields b r v) (EdgeFields b r v)
- _ConnectionPageInfo :: forall b r v. Prism' (ConnectionField b r v) PageInfoFields
- _ConnectionTypename :: forall b r v. Prism' (ConnectionField b r v) Text
- _EdgeNode :: forall b r v b r v. Prism (EdgeField b r v) (EdgeField b r v) (AnnFieldsG b r v) (AnnFieldsG b r v)
- _EdgeCursor :: forall b r v. Prism' (EdgeField b r v) ()
- _EdgeTypename :: forall b r v. Prism' (EdgeField b r v) Text
Documentation
data QueryDB (b :: BackendType) (r :: Type) v Source #
QDBMultipleRows (AnnSimpleSelectG b r v) | |
QDBSingleRow (AnnSimpleSelectG b r v) | |
QDBAggregation (AnnAggregateSelectG b r v) | |
QDBConnection (ConnectionSelect b r v) | |
QDBStreamMultipleRows (AnnSimpleStreamSelectG b r v) |
Instances
data AnnSelectG (b :: BackendType) (f :: Type -> Type) (v :: Type) Source #
AnnSelectG | |
|
Instances
(Backend b, Functor f) => Functor (AnnSelectG b f) Source # | |
Defined in Hasura.RQL.IR.Select fmap :: (a -> b0) -> AnnSelectG b f a -> AnnSelectG b f b0 # (<$) :: a -> AnnSelectG b f b0 -> AnnSelectG b f a # | |
(Backend b, Foldable f) => Foldable (AnnSelectG b f) Source # | |
Defined in Hasura.RQL.IR.Select fold :: Monoid m => AnnSelectG b f m -> m # foldMap :: Monoid m => (a -> m) -> AnnSelectG b f a -> m # foldMap' :: Monoid m => (a -> m) -> AnnSelectG b f a -> m # foldr :: (a -> b0 -> b0) -> b0 -> AnnSelectG b f a -> b0 # foldr' :: (a -> b0 -> b0) -> b0 -> AnnSelectG b f a -> b0 # foldl :: (b0 -> a -> b0) -> b0 -> AnnSelectG b f a -> b0 # foldl' :: (b0 -> a -> b0) -> b0 -> AnnSelectG b f a -> b0 # foldr1 :: (a -> a -> a) -> AnnSelectG b f a -> a # foldl1 :: (a -> a -> a) -> AnnSelectG b f a -> a # toList :: AnnSelectG b f a -> [a] # null :: AnnSelectG b f a -> Bool # length :: AnnSelectG b f a -> Int # elem :: Eq a => a -> AnnSelectG b f a -> Bool # maximum :: Ord a => AnnSelectG b f a -> a # minimum :: Ord a => AnnSelectG b f a -> a # sum :: Num a => AnnSelectG b f a -> a # product :: Num a => AnnSelectG b f a -> a # | |
(Backend b, Traversable f) => Traversable (AnnSelectG b f) Source # | |
Defined in Hasura.RQL.IR.Select traverse :: Applicative f0 => (a -> f0 b0) -> AnnSelectG b f a -> f0 (AnnSelectG b f b0) # sequenceA :: Applicative f0 => AnnSelectG b f (f0 a) -> f0 (AnnSelectG b f a) # mapM :: Monad m => (a -> m b0) -> AnnSelectG b f a -> m (AnnSelectG b f b0) # sequence :: Monad m => AnnSelectG b f (m a) -> m (AnnSelectG b f a) # | |
(Backend b, Eq (Fields (f v)), Eq (SelectArgsG b v), Eq (SelectFromG b v), Eq (TablePermG b v)) => Eq (AnnSelectG b f v) Source # | |
Defined in Hasura.RQL.IR.Select (==) :: AnnSelectG b f v -> AnnSelectG b f v -> Bool # (/=) :: AnnSelectG b f v -> AnnSelectG b f v -> Bool # | |
(Backend b, Show (Fields (f v)), Show (SelectArgsG b v), Show (SelectFromG b v), Show (TablePermG b v)) => Show (AnnSelectG b f v) Source # | |
Defined in Hasura.RQL.IR.Select showsPrec :: Int -> AnnSelectG b f v -> ShowS # show :: AnnSelectG b f v -> String # showList :: [AnnSelectG b f v] -> ShowS # |
data AnnSelectStreamG (b :: BackendType) (f :: Type -> Type) (v :: Type) Source #
IR type representing nodes for streaming subscriptions
AnnSelectStreamG | |
|
Instances
type AnnSimpleSelectG b r v = AnnSelectG b (AnnFieldG b r) v Source #
type AnnAggregateSelectG b r v = AnnSelectG b (TableAggregateFieldG b r) v Source #
type AnnSimpleStreamSelectG b r v = AnnSelectStreamG b (AnnFieldG b r) v Source #
type AnnSimpleSelect b = AnnSimpleSelectG b Void (SQLExpression b) Source #
type AnnAggregateSelect b = AnnAggregateSelectG b Void (SQLExpression b) Source #
type AnnSimpleStreamSelect b = AnnSimpleStreamSelectG b Void (SQLExpression b) Source #
bifoldMapAnnSelectG :: (Backend b, Bifoldable (f b), Monoid m) => (r -> m) -> (v -> m) -> AnnSelectG b (f b r) v -> m Source #
We can't write a Bifoldable instance for AnnSelectG because the types don't line up. Instead, we provide this function which can be used to help define Bifoldable instances of other types containing AnnSelectG values.
bifoldMapAnnSelectStreamG :: (Backend b, Bifoldable (f b), Monoid m) => (r -> m) -> (v -> m) -> AnnSelectStreamG b (f b r) v -> m Source #
data ConnectionSelect (b :: BackendType) (r :: Type) v Source #
ConnectionSelect | |
|
Instances
data ConnectionSplit (b :: BackendType) v Source #
ConnectionSplit | |
|
Instances
data ConnectionSlice Source #
Instances
data ConnectionSplitKind Source #
Instances
Eq ConnectionSplitKind Source # | |
Defined in Hasura.RQL.IR.Select (==) :: ConnectionSplitKind -> ConnectionSplitKind -> Bool # (/=) :: ConnectionSplitKind -> ConnectionSplitKind -> Bool # | |
Show ConnectionSplitKind Source # | |
Defined in Hasura.RQL.IR.Select showsPrec :: Int -> ConnectionSplitKind -> ShowS # show :: ConnectionSplitKind -> String # showList :: [ConnectionSplitKind] -> ShowS # | |
Generic ConnectionSplitKind Source # | |
Defined in Hasura.RQL.IR.Select type Rep ConnectionSplitKind :: Type -> Type # from :: ConnectionSplitKind -> Rep ConnectionSplitKind x # to :: Rep ConnectionSplitKind x -> ConnectionSplitKind # | |
Hashable ConnectionSplitKind Source # | |
Defined in Hasura.RQL.IR.Select hashWithSalt :: Int -> ConnectionSplitKind -> Int hash :: ConnectionSplitKind -> Int | |
type Rep ConnectionSplitKind Source # | |
newtype FIIdentifier Source #
Identifier used exclusively as the argument to FromIdentifier
FIIdentifier | |
|
Instances
data SelectFromG (b :: BackendType) v Source #
FromTable (TableName b) | |
FromIdentifier FIIdentifier | |
FromFunction (FunctionName b) (FunctionArgsExp b v) (Maybe [(Column b, ScalarType b)]) |
Instances
type SelectFrom b = SelectFromG b (SQLExpression b) Source #
data SelectStreamArgsG (b :: BackendType) v Source #
SelectStreamArgsG | |
|
Instances
type SelectStreamArgs b = SelectStreamArgsG b (SQLExpression b) Source #
data SelectArgsG (b :: BackendType) v Source #
SelectArgs | |
|
Instances
type SelectArgs b = SelectArgsG b (SQLExpression b) Source #
noSelectArgs :: SelectArgsG backend v Source #
data ComputedFieldOrderByElement (b :: BackendType) v Source #
The order by element for a computed field based on its return type
CFOBEScalar (ScalarType b) | Sort by the scalar computed field |
CFOBETableAggregation | |
|
Instances
data ComputedFieldOrderBy (b :: BackendType) v Source #
Instances
data AnnotatedOrderByElement (b :: BackendType) v Source #
AOCColumn (ColumnInfo b) | |
AOCObjectRelation | |
| |
AOCArrayAggregation | |
| |
AOCComputedField (ComputedFieldOrderBy b v) |
Instances
data AnnotatedAggregateOrderBy (b :: BackendType) Source #
AAOCount | |
AAOOp Text (ColumnInfo b) |
Instances
type AnnotatedOrderByItemG b v = OrderByItemG b (AnnotatedOrderByElement b v) Source #
type AnnotatedOrderByItem b = AnnotatedOrderByItemG b (SQLExpression b) Source #
data StreamCursorItem (b :: BackendType) Source #
Cursor for streaming subscription
StreamCursorItem | |
|
Instances
data RemoteRelationshipSelect b r Source #
captures a remote relationship's selection and the necessary context
RemoteRelationshipSelect | |
|
Instances
data AnnFieldG (b :: BackendType) (r :: Type) v Source #
AFColumn (AnnColumnField b v) | |
AFObjectRelation (ObjectRelationSelectG b r v) | |
AFArrayRelation (ArraySelectG b r v) | |
AFComputedField (XComputedField b) ComputedFieldName (ComputedFieldSelect b r v) | |
AFRemote (RemoteRelationshipSelect b r) | A remote relationship field |
AFNodeId (XRelay b) SourceName (TableName b) (PrimaryKeyColumns b) | |
AFExpression Text |
Instances
type AnnFields b = AnnFieldsG b Void (SQLExpression b) Source #
mkAnnColumnField :: Column backend -> ColumnType backend -> Maybe (AnnColumnCaseBoolExp backend v) -> Maybe (ScalarSelectionArguments backend) -> AnnFieldG backend r v Source #
mkAnnColumnFieldAsText :: ColumnInfo backend -> AnnFieldG backend r v Source #
traverseSourceRelationshipSelection :: (Applicative f, Backend backend) => (vf backend -> f (vg backend)) -> SourceRelationshipSelection backend r vf -> f (SourceRelationshipSelection backend r vg) Source #
data TableAggregateFieldG (b :: BackendType) (r :: Type) v Source #
TAFAgg (AggregateFields b) | |
TAFNodes (XNodesAgg b) (AnnFieldsG b r v) | |
TAFExp Text |
Instances
data AggregateField (b :: BackendType) Source #
AFCount (CountType b) | |
AFOp (AggregateOp b) | |
AFExp Text |
Instances
Backend b => Eq (AggregateField b) Source # | |
Defined in Hasura.RQL.IR.Select (==) :: AggregateField b -> AggregateField b -> Bool # (/=) :: AggregateField b -> AggregateField b -> Bool # | |
Backend b => Show (AggregateField b) Source # | |
Defined in Hasura.RQL.IR.Select showsPrec :: Int -> AggregateField b -> ShowS # show :: AggregateField b -> String # showList :: [AggregateField b] -> ShowS # |
data AggregateOp (b :: BackendType) Source #
AggregateOp | |
|
Instances
Backend b => Eq (AggregateOp b) Source # | |
Defined in Hasura.RQL.IR.Select (==) :: AggregateOp b -> AggregateOp b -> Bool # (/=) :: AggregateOp b -> AggregateOp b -> Bool # | |
Backend b => Show (AggregateOp b) Source # | |
Defined in Hasura.RQL.IR.Select showsPrec :: Int -> AggregateOp b -> ShowS # show :: AggregateOp b -> String # showList :: [AggregateOp b] -> ShowS # |
data ColFld (b :: BackendType) Source #
CFCol (Column b) (ColumnType b) | |
CFExp Text |
type TableAggregateField b = TableAggregateFieldG b Void (SQLExpression b) Source #
type TableAggregateFields b = TableAggregateFieldsG b Void (SQLExpression b) Source #
type TableAggregateFieldsG b r v = Fields (TableAggregateFieldG b r v) Source #
type ColumnFields b = Fields (ColFld b) Source #
type AggregateFields b = Fields (AggregateField b) Source #
type AnnFieldsG b r v = Fields (AnnFieldG b r v) Source #
data ConnectionField (b :: BackendType) (r :: Type) v Source #
Instances
data PageInfoField Source #
PageInfoTypename Text | |
PageInfoHasNextPage | |
PageInfoHasPreviousPage | |
PageInfoStartCursor | |
PageInfoEndCursor |
Instances
Eq PageInfoField Source # | |
Defined in Hasura.RQL.IR.Select (==) :: PageInfoField -> PageInfoField -> Bool # (/=) :: PageInfoField -> PageInfoField -> Bool # | |
Show PageInfoField Source # | |
Defined in Hasura.RQL.IR.Select showsPrec :: Int -> PageInfoField -> ShowS # show :: PageInfoField -> String # showList :: [PageInfoField] -> ShowS # |
data EdgeField (b :: BackendType) (r :: Type) v Source #
EdgeTypename Text | |
EdgeCursor | |
EdgeNode (AnnFieldsG b r v) |
Instances
Backend b => Bifoldable (EdgeField b) Source # | |
Backend b => Functor (EdgeField b r) Source # | |
Backend b => Foldable (EdgeField b r) Source # | |
Defined in Hasura.RQL.IR.Select fold :: Monoid m => EdgeField b r m -> m # foldMap :: Monoid m => (a -> m) -> EdgeField b r a -> m # foldMap' :: Monoid m => (a -> m) -> EdgeField b r a -> m # foldr :: (a -> b0 -> b0) -> b0 -> EdgeField b r a -> b0 # foldr' :: (a -> b0 -> b0) -> b0 -> EdgeField b r a -> b0 # foldl :: (b0 -> a -> b0) -> b0 -> EdgeField b r a -> b0 # foldl' :: (b0 -> a -> b0) -> b0 -> EdgeField b r a -> b0 # foldr1 :: (a -> a -> a) -> EdgeField b r a -> a # foldl1 :: (a -> a -> a) -> EdgeField b r a -> a # toList :: EdgeField b r a -> [a] # null :: EdgeField b r a -> Bool # length :: EdgeField b r a -> Int # elem :: Eq a => a -> EdgeField b r a -> Bool # maximum :: Ord a => EdgeField b r a -> a # minimum :: Ord a => EdgeField b r a -> a # | |
Backend b => Traversable (EdgeField b r) Source # | |
Defined in Hasura.RQL.IR.Select traverse :: Applicative f => (a -> f b0) -> EdgeField b r a -> f (EdgeField b r b0) # sequenceA :: Applicative f => EdgeField b r (f a) -> f (EdgeField b r a) # mapM :: Monad m => (a -> m b0) -> EdgeField b r a -> m (EdgeField b r b0) # sequence :: Monad m => EdgeField b r (m a) -> m (EdgeField b r a) # | |
Eq (AnnFieldsG b r v) => Eq (EdgeField b r v) Source # | |
Show (AnnFieldsG b r v) => Show (EdgeField b r v) Source # | |
type ConnectionFields b r v = Fields (ConnectionField b r v) Source #
type PageInfoFields = Fields PageInfoField Source #
type EdgeFields b r v = Fields (EdgeField b r v) Source #
data AnnColumnField (b :: BackendType) v Source #
AnnColumnField | |
|
Instances
data ComputedFieldScalarSelect (b :: BackendType) v Source #
ComputedFieldScalarSelect | |
|
Instances
data ComputedFieldSelect (b :: BackendType) (r :: Type) v Source #
CFSScalar | |
| |
CFSTable JsonAggSelect (AnnSimpleSelectG b r v) |
Instances
data AnnRelationSelectG (b :: BackendType) a Source #
AnnRelationSelectG | |
|
Instances
type ArrayRelationSelectG b r v = AnnRelationSelectG b (AnnSimpleSelectG b r v) Source #
type ArrayAggregateSelectG b r v = AnnRelationSelectG b (AnnAggregateSelectG b r v) Source #
type ArrayConnectionSelect b r v = AnnRelationSelectG b (ConnectionSelect b r v) Source #
type ArrayAggregateSelect b = ArrayAggregateSelectG b Void (SQLExpression b) Source #
data AnnObjectSelectG (b :: BackendType) (r :: Type) v Source #
AnnObjectSelectG | |
|
Instances
type AnnObjectSelect b r = AnnObjectSelectG b r (SQLExpression b) Source #
type ObjectRelationSelectG b r v = AnnRelationSelectG b (AnnObjectSelectG b r v) Source #
type ObjectRelationSelect b = ObjectRelationSelectG b Void (SQLExpression b) Source #
data ArraySelectG (b :: BackendType) (r :: Type) v Source #
ASSimple (ArrayRelationSelectG b r v) | |
ASAggregate (ArrayAggregateSelectG b r v) | |
ASConnection (ArrayConnectionSelect b r v) |
Instances
type ArraySelect b = ArraySelectG b Void (SQLExpression b) Source #
type ArraySelectFieldsG b r v = Fields (ArraySelectG b r v) Source #
data SourceRelationshipSelection (b :: BackendType) (r :: Type) (vf :: BackendType -> Type) Source #
Captures the selection set of a remote source relationship.
SourceRelationshipObject (AnnObjectSelectG b r (vf b)) | |
SourceRelationshipArray (AnnSimpleSelectG b r (vf b)) | |
SourceRelationshipArrayAggregate (AnnAggregateSelectG b r (vf b)) |
Instances
(Backend b, Eq (AnnAggregateSelectG b r (vf b)), Eq (AnnObjectSelectG b r (vf b)), Eq (AnnSimpleSelectG b r (vf b))) => Eq (SourceRelationshipSelection b r vf) Source # | |
Defined in Hasura.RQL.IR.Select (==) :: SourceRelationshipSelection b r vf -> SourceRelationshipSelection b r vf -> Bool # (/=) :: SourceRelationshipSelection b r vf -> SourceRelationshipSelection b r vf -> Bool # | |
(Backend b, Show (AnnAggregateSelectG b r (vf b)), Show (AnnObjectSelectG b r (vf b)), Show (AnnSimpleSelectG b r (vf b))) => Show (SourceRelationshipSelection b r vf) Source # | |
Defined in Hasura.RQL.IR.Select showsPrec :: Int -> SourceRelationshipSelection b r vf -> ShowS # show :: SourceRelationshipSelection b r vf -> String # showList :: [SourceRelationshipSelection b r vf] -> ShowS # |
data RemoteSourceSelect (r :: Type) (vf :: BackendType -> Type) (tgt :: BackendType) Source #
A relationship to a remote source. vf
(could use a better name) is
analogous to v
in other IR types such as AnnFieldG
. vf's kind is
(BackendType -> Type) instead of v's Type
so that v
of AnnFieldG
can
be specific to the backend that it captures (b
of an AnnFieldG changes as
we walk down the IR branches which capture relationships to other databases)
RemoteSourceSelect | |
|
Instances
(Backend tgt, Eq (SourceRelationshipSelection tgt r vf)) => Eq (RemoteSourceSelect r vf tgt) Source # | |
Defined in Hasura.RQL.IR.Select (==) :: RemoteSourceSelect r vf tgt -> RemoteSourceSelect r vf tgt -> Bool # (/=) :: RemoteSourceSelect r vf tgt -> RemoteSourceSelect r vf tgt -> Bool # |
data TablePermG (b :: BackendType) v Source #
Instances
type TablePerm b = TablePermG b (SQLExpression b) Source #
noTablePermissions :: TablePermG backend v Source #
insertFunctionArg :: FunctionArgName -> Int -> a -> FunctionArgsExpG a -> FunctionArgsExpG a Source #
If argument positional index is less than or equal to length of
positional
arguments then insert the value in positional
arguments else
insert the value with argument name in named
arguments
data CountDistinct Source #
The "distinct" input field inside "count" aggregate field
count ( distinct: Boolean ): Int
asnStrfyNum :: forall b f v. Lens' (AnnSelectG b f v) StringifyNumbers Source #
asnPerm :: forall b f v. Lens' (AnnSelectG b f v) (TablePermG b v) Source #
asnNamingConvention :: forall b f v. Lens' (AnnSelectG b f v) (Maybe NamingCase) Source #
asnFrom :: forall b f v. Lens' (AnnSelectG b f v) (SelectFromG b v) Source #
asnFields :: forall b f v f. Lens (AnnSelectG b f v) (AnnSelectG b f v) (Fields (f v)) (Fields (f v)) Source #
asnArgs :: forall b f v. Lens' (AnnSelectG b f v) (SelectArgsG b v) Source #
aosTableFrom :: forall b r v. Lens' (AnnObjectSelectG b r v) (TableName b) Source #
aosTableFilter :: forall b r v. Lens' (AnnObjectSelectG b r v) (AnnBoolExp b v) Source #
aosFields :: forall b r v r. Lens (AnnObjectSelectG b r v) (AnnObjectSelectG b r v) (AnnFieldsG b r v) (AnnFieldsG b r v) Source #
aarRelationshipName :: forall b a. Lens' (AnnRelationSelectG b a) RelName Source #
aarColumnMapping :: forall b a b. Lens (AnnRelationSelectG b a) (AnnRelationSelectG b a) (HashMap (Column b) (Column b)) (HashMap (Column b) (Column b)) Source #
aarAnnSelect :: forall b a a. Lens (AnnRelationSelectG b a) (AnnRelationSelectG b a) a a Source #
csXRelay :: forall b r v. Lens' (ConnectionSelect b r v) (XRelay b) Source #
csSplit :: forall b r v. Lens' (ConnectionSelect b r v) (Maybe (NonEmpty (ConnectionSplit b v))) Source #
csSlice :: forall b r v. Lens' (ConnectionSelect b r v) (Maybe ConnectionSlice) Source #
csSelect :: forall b r v r. Lens (ConnectionSelect b r v) (ConnectionSelect b r v) (AnnSelectG b (ConnectionField b r) v) (AnnSelectG b (ConnectionField b r) v) Source #
csPrimaryKeyColumns :: forall b r v. Lens' (ConnectionSelect b r v) (PrimaryKeyColumns b) Source #
saWhere :: forall b v. Lens' (SelectArgsG b v) (Maybe (AnnBoolExp b v)) Source #
saOrderBy :: forall b v. Lens' (SelectArgsG b v) (Maybe (NonEmpty (AnnotatedOrderByItemG b v))) Source #
saDistinct :: forall b v. Lens' (SelectArgsG b v) (Maybe (NonEmpty (Column b))) Source #
_AFExpression :: forall b r v. Prism' (AnnFieldG b r v) Text Source #
_AFNodeId :: forall b r v. Prism' (AnnFieldG b r v) (XRelay b, SourceName, TableName b, PrimaryKeyColumns b) Source #
_AFRemote :: forall b r v. Prism' (AnnFieldG b r v) (RemoteRelationshipSelect b r) Source #
_AFComputedField :: forall b r v. Prism' (AnnFieldG b r v) (XComputedField b, ComputedFieldName, ComputedFieldSelect b r v) Source #
_AFArrayRelation :: forall b r v. Prism' (AnnFieldG b r v) (ArraySelectG b r v) Source #
_AFObjectRelation :: forall b r v. Prism' (AnnFieldG b r v) (ObjectRelationSelectG b r v) Source #
_AFColumn :: forall b r v. Prism' (AnnFieldG b r v) (AnnColumnField b v) Source #
_AOCComputedField :: forall b v. Prism' (AnnotatedOrderByElement b v) (ComputedFieldOrderBy b v) Source #
_AOCArrayAggregation :: forall b v. Prism' (AnnotatedOrderByElement b v) (RelInfo b, AnnBoolExp b v, AnnotatedAggregateOrderBy b) Source #
_AOCObjectRelation :: forall b v. Prism' (AnnotatedOrderByElement b v) (RelInfo b, AnnBoolExp b v, AnnotatedOrderByElement b v) Source #
_AOCColumn :: forall b v. Prism' (AnnotatedOrderByElement b v) (ColumnInfo b) Source #
_TAFExp :: forall b r v. Prism' (TableAggregateFieldG b r v) Text Source #
_TAFNodes :: forall b r v r v. Prism (TableAggregateFieldG b r v) (TableAggregateFieldG b r v) (XNodesAgg b, AnnFieldsG b r v) (XNodesAgg b, AnnFieldsG b r v) Source #
_TAFAgg :: forall b r v. Prism' (TableAggregateFieldG b r v) (AggregateFields b) Source #
_ConnectionEdges :: forall b r v b r v. Prism (ConnectionField b r v) (ConnectionField b r v) (EdgeFields b r v) (EdgeFields b r v) Source #
_ConnectionPageInfo :: forall b r v. Prism' (ConnectionField b r v) PageInfoFields Source #
_ConnectionTypename :: forall b r v. Prism' (ConnectionField b r v) Text Source #
_EdgeNode :: forall b r v b r v. Prism (EdgeField b r v) (EdgeField b r v) (AnnFieldsG b r v) (AnnFieldsG b r v) Source #
_EdgeCursor :: forall b r v. Prism' (EdgeField b r v) () Source #
_EdgeTypename :: forall b r v. Prism' (EdgeField b r v) Text Source #