Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type Representable a = (Show a, Eq a, Hashable a, Cacheable a, NFData a)
- type SessionVarType b = CollectableType (ScalarType b)
- data ComputedFieldReturnType (b :: BackendType)
- = ReturnsScalar (ScalarType b)
- | ReturnsTable (TableName b)
- | ReturnsOthers
- type XEnable = ()
- type XDisable = Void
- data SupportedNamingCase
- class (Representable (TableName b), Representable (FunctionName b), Representable (FunctionArgument b), Representable (ConstraintName b), Representable (BasicOrderType b), Representable (NullsOrderType b), Representable (Column b), Representable (ScalarType b), Representable (SQLExpression b), Representable (ScalarSelectionArguments b), Representable (SourceConnConfiguration b), Representable (ExtraTableMetadata b), Representable (XComputedField b), Representable (ComputedFieldDefinition b), Representable (ComputedFieldImplicitArguments b), Representable (ComputedFieldReturn b), Ord (TableName b), Ord (FunctionName b), Ord (ScalarType b), Data (TableName b), FromJSON (BackendConfig b), FromJSON (Column b), FromJSON (ConstraintName b), FromJSON (FunctionName b), FromJSON (ScalarType b), FromJSON (TableName b), FromJSON (SourceConnConfiguration b), FromJSON (ExtraTableMetadata b), FromJSON (ComputedFieldDefinition b), FromJSON (BackendSourceKind b), FromJSONKey (Column b), HasCodec (BackendSourceKind b), HasCodec (SourceConnConfiguration b), ToJSON (BackendConfig b), ToJSON (Column b), ToJSON (ConstraintName b), ToJSON (FunctionArgument b), ToJSON (FunctionName b), ToJSON (ScalarType b), ToJSON (SourceConfig b), ToJSON (TableName b), ToJSON (SourceConnConfiguration b), ToJSON (ExtraTableMetadata b), ToJSON (SQLExpression b), ToJSON (ComputedFieldDefinition b), ToJSON (ComputedFieldImplicitArguments b), ToJSON (ComputedFieldReturn b), ToJSONKey (Column b), ToJSONKey (FunctionName b), ToJSONKey (ScalarType b), ToJSONKey (TableName b), ToTxt (Column b), ToTxt (FunctionName b), ToTxt (ScalarType b), ToTxt (TableName b), ToTxt (ConstraintName b), ToErrorValue (Column b), ToErrorValue (FunctionName b), ToErrorValue (ScalarType b), ToErrorValue (TableName b), ToErrorValue (ConstraintName b), Cacheable (SourceConfig b), Cacheable (BackendConfig b), Typeable (TableName b), Typeable (ConstraintName b), Typeable b, HasTag b, Functor (FunctionArgumentExp b), Foldable (FunctionArgumentExp b), Traversable (FunctionArgumentExp b), Eq (BackendConfig b), Show (BackendConfig b), Monoid (BackendConfig b), Eq (CountType b), Show (CountType b), Eq (ScalarValue b), Show (ScalarValue b), Eq (XNodesAgg b), Show (XNodesAgg b), Eq (XRelay b), Show (XRelay b), Eq (XStreamingSubscription b), Show (XStreamingSubscription b), Traversable (BooleanOperators b), Functor (BackendUpdate b), Foldable (BackendUpdate b), Traversable (BackendUpdate b), Functor (BackendInsert b), Foldable (BackendInsert b), Traversable (BackendInsert b), Functor (AggregationPredicates b), Foldable (AggregationPredicates b), Traversable (AggregationPredicates b)) => Backend (b :: BackendType) where
- type BackendConfig b :: Type
- type SourceConnConfiguration b :: Type
- type SourceConfig b :: Type
- type TableName b :: Type
- type FunctionName b :: Type
- type RawFunctionInfo b :: Type
- type ConstraintName b :: Type
- type BasicOrderType b :: Type
- type NullsOrderType b :: Type
- type CountType b :: Type
- type Column b :: Type
- type ScalarValue b :: Type
- type ScalarType b :: Type
- type SQLExpression b :: Type
- type ComputedFieldDefinition b :: Type
- type ScalarSelectionArguments b :: Type
- type ExtraTableMetadata b :: Type
- type FunctionArgument b :: Type
- type FunctionArgumentExp b :: Type -> Type
- type ComputedFieldImplicitArguments b :: Type
- type ComputedFieldReturn b :: Type
- type BooleanOperators b :: Type -> Type
- type AggregationPredicates b :: Type -> Type
- type BackendUpdate b :: Type -> Type
- type BackendInsert b :: Type -> Type
- type XComputedField b :: Type
- type XRelay b :: Type
- type XNodesAgg b :: Type
- type XNestedInserts b :: Type
- type XStreamingSubscription b :: Type
- isComparableType :: ScalarType b -> Bool
- isNumType :: ScalarType b -> Bool
- textToScalarValue :: Maybe Text -> ScalarValue b
- parseScalarValue :: ScalarType b -> Value -> Either QErr (ScalarValue b)
- scalarValueToJSON :: ScalarValue b -> Value
- functionToTable :: FunctionName b -> TableName b
- tableToFunction :: TableName b -> FunctionName b
- computedFieldFunction :: ComputedFieldDefinition b -> FunctionName b
- computedFieldReturnType :: ComputedFieldReturn b -> ComputedFieldReturnType b
- fromComputedFieldImplicitArguments :: v -> ComputedFieldImplicitArguments b -> [FunctionArgumentExp b v]
- tableGraphQLName :: TableName b -> Either QErr Name
- functionGraphQLName :: FunctionName b -> Either QErr Name
- getTableIdentifier :: TableName b -> Either QErr GQLNameIdentifier
- snakeCaseTableName :: TableName b -> Text
- namingConventionSupport :: SupportedNamingCase
- _ReturnsOthers :: forall b. Prism' (ComputedFieldReturnType b) ()
- _ReturnsTable :: forall b. Prism' (ComputedFieldReturnType b) (TableName b)
- _ReturnsScalar :: forall b. Prism' (ComputedFieldReturnType b) (ScalarType b)
Documentation
type SessionVarType b = CollectableType (ScalarType b) Source #
data ComputedFieldReturnType (b :: BackendType) Source #
data SupportedNamingCase Source #
Used for keeping track of the extent of support of naming convention across different backends.
AllConventions
implies a full support whereas OnlyHasuraCase
implies
a partial support of only HasuraCase
class (Representable (TableName b), Representable (FunctionName b), Representable (FunctionArgument b), Representable (ConstraintName b), Representable (BasicOrderType b), Representable (NullsOrderType b), Representable (Column b), Representable (ScalarType b), Representable (SQLExpression b), Representable (ScalarSelectionArguments b), Representable (SourceConnConfiguration b), Representable (ExtraTableMetadata b), Representable (XComputedField b), Representable (ComputedFieldDefinition b), Representable (ComputedFieldImplicitArguments b), Representable (ComputedFieldReturn b), Ord (TableName b), Ord (FunctionName b), Ord (ScalarType b), Data (TableName b), FromJSON (BackendConfig b), FromJSON (Column b), FromJSON (ConstraintName b), FromJSON (FunctionName b), FromJSON (ScalarType b), FromJSON (TableName b), FromJSON (SourceConnConfiguration b), FromJSON (ExtraTableMetadata b), FromJSON (ComputedFieldDefinition b), FromJSON (BackendSourceKind b), FromJSONKey (Column b), HasCodec (BackendSourceKind b), HasCodec (SourceConnConfiguration b), ToJSON (BackendConfig b), ToJSON (Column b), ToJSON (ConstraintName b), ToJSON (FunctionArgument b), ToJSON (FunctionName b), ToJSON (ScalarType b), ToJSON (SourceConfig b), ToJSON (TableName b), ToJSON (SourceConnConfiguration b), ToJSON (ExtraTableMetadata b), ToJSON (SQLExpression b), ToJSON (ComputedFieldDefinition b), ToJSON (ComputedFieldImplicitArguments b), ToJSON (ComputedFieldReturn b), ToJSONKey (Column b), ToJSONKey (FunctionName b), ToJSONKey (ScalarType b), ToJSONKey (TableName b), ToTxt (Column b), ToTxt (FunctionName b), ToTxt (ScalarType b), ToTxt (TableName b), ToTxt (ConstraintName b), ToErrorValue (Column b), ToErrorValue (FunctionName b), ToErrorValue (ScalarType b), ToErrorValue (TableName b), ToErrorValue (ConstraintName b), Cacheable (SourceConfig b), Cacheable (BackendConfig b), Typeable (TableName b), Typeable (ConstraintName b), Typeable b, HasTag b, Functor (FunctionArgumentExp b), Foldable (FunctionArgumentExp b), Traversable (FunctionArgumentExp b), Eq (BackendConfig b), Show (BackendConfig b), Monoid (BackendConfig b), Eq (CountType b), Show (CountType b), Eq (ScalarValue b), Show (ScalarValue b), Eq (XNodesAgg b), Show (XNodesAgg b), Eq (XRelay b), Show (XRelay b), Eq (XStreamingSubscription b), Show (XStreamingSubscription b), Traversable (BooleanOperators b), Functor (BackendUpdate b), Foldable (BackendUpdate b), Traversable (BackendUpdate b), Functor (BackendInsert b), Foldable (BackendInsert b), Traversable (BackendInsert b), Functor (AggregationPredicates b), Foldable (AggregationPredicates b), Traversable (AggregationPredicates b)) => Backend (b :: BackendType) where Source #
Mapping from abstract types to concrete backend representation
The RQL IR, used as the output of GraphQL parsers and of the RQL parsers, is backend-agnostic: it uses an abstract representation of the structure of a query, and delegates to the backends the task of choosing an appropriate concrete representation.
Additionally, grouping all those types under one typeclass rather than having dedicated type families allows to explicitly list all typeclass requirements, which simplifies the instance declarations of all IR types.
There are no injectivity requirements on those type families: it's
okay for two different backends to use the same types. That means,
however, that functions cannot identify to what backend b a given
TableName b
refers to; most generic functions will need either a
type application or a Proxy
parameter to disambiguate between
different backends at the call site.
type BackendConfig b :: Type Source #
type SourceConnConfiguration b :: Type Source #
User facing connection configuration for a database.
type SourceConfig b :: Type Source #
Internal connection configuration for a database - connection string, connection pool etc
type TableName b :: Type Source #
type FunctionName b :: Type Source #
type RawFunctionInfo b :: Type Source #
type ConstraintName b :: Type Source #
type BasicOrderType b :: Type Source #
type NullsOrderType b :: Type Source #
type CountType b :: Type Source #
type Column b :: Type Source #
type ScalarValue b :: Type Source #
type ScalarType b :: Type Source #
type SQLExpression b :: Type Source #
type ComputedFieldDefinition b :: Type Source #
type ScalarSelectionArguments b :: Type Source #
Arguments of a scalar field's selection { query { some_table { # a scalar field column(ScalarSelectionArguments) } } }
type ExtraTableMetadata b :: Type Source #
type FunctionArgument b :: Type Source #
FunctionArgument
type FunctionArgumentExp b :: Type -> Type Source #
Function input argument expression
It is parameterised over the type of fields, which changes during the IR translation phases.
type ComputedFieldImplicitArguments b :: Type Source #
Computed field function argument values which are being implicitly inferred from table and/or session information
type ComputedFieldReturn b :: Type Source #
Computed field return information
type BooleanOperators b :: Type -> Type Source #
Intermediate Representation of extensions to the shared set of boolean operators on table fields.
It is parameterised over the type of fields, which changes during the IR translation phases.
type AggregationPredicates b :: Type -> Type Source #
Intermediate Representation of aggregation predicates. The default implementation makes aggregation predicates uninstantiable.
It is parameterised over the type of fields, which changes during the IR translation phases.
type AggregationPredicates b = Const Void
type BackendUpdate b :: Type -> Type Source #
Intermediate Representation of Update Mutations. The default implementation makes update expressions uninstantiable.
It is parameterised over the type of fields, which changes during the IR translation phases.
type BackendUpdate b = Const Void
type BackendInsert b :: Type -> Type Source #
Intermediate Representation of Insert Mutations. The default implementation makes insert expressions uninstantiable.
It is parameterised over the type of fields, which changes during the IR translation phases.
type BackendInsert b = Const Void
type XComputedField b :: Type Source #
type XRelay b :: Type Source #
type XNodesAgg b :: Type Source #
type XNestedInserts b :: Type Source #
Extension to flag the availability of object and array relationships in inserts (aka nested inserts).
type XStreamingSubscription b :: Type Source #
isComparableType :: ScalarType b -> Bool Source #
isNumType :: ScalarType b -> Bool Source #
textToScalarValue :: Maybe Text -> ScalarValue b Source #
parseScalarValue :: ScalarType b -> Value -> Either QErr (ScalarValue b) Source #
scalarValueToJSON :: ScalarValue b -> Value Source #
functionToTable :: FunctionName b -> TableName b Source #
tableToFunction :: TableName b -> FunctionName b Source #
computedFieldFunction :: ComputedFieldDefinition b -> FunctionName b Source #
computedFieldReturnType :: ComputedFieldReturn b -> ComputedFieldReturnType b Source #
fromComputedFieldImplicitArguments :: v -> ComputedFieldImplicitArguments b -> [FunctionArgumentExp b v] Source #
Build function arguments expression from computed field implicit arguments
tableGraphQLName :: TableName b -> Either QErr Name Source #
functionGraphQLName :: FunctionName b -> Either QErr Name Source #
getTableIdentifier :: TableName b -> Either QErr GQLNameIdentifier Source #
snakeCaseTableName :: TableName b -> Text Source #
Instances
_ReturnsOthers :: forall b. Prism' (ComputedFieldReturnType b) () Source #
_ReturnsTable :: forall b. Prism' (ComputedFieldReturnType b) (TableName b) Source #
_ReturnsScalar :: forall b. Prism' (ComputedFieldReturnType b) (ScalarType b) Source #