Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype EnumValue = EnumValue {
- getEnumValue :: Name
- newtype EnumValueInfo = EnumValueInfo {}
- type EnumValues = HashMap EnumValue EnumValueInfo
- data EnumReference (b :: BackendType) = EnumReference {
- erTable :: TableName b
- erValues :: EnumValues
- erTableCustomName :: Maybe Name
- data ColumnType (b :: BackendType)
- = ColumnScalar (ScalarType b)
- | ColumnEnumReference (EnumReference b)
- _ColumnEnumReference :: forall b. Prism' (ColumnType b) (EnumReference b)
- _ColumnScalar :: forall b. Prism' (ColumnType b) (ScalarType b)
- type ValueParser b m v = CollectableType (ColumnType b) -> Value -> m v
- data ColumnValue (b :: BackendType) = ColumnValue {
- cvType :: ColumnType b
- cvValue :: ScalarValue b
- isScalarColumnWhere :: (ScalarType b -> Bool) -> ColumnType b -> Bool
- isEnumColumn :: ColumnType b -> Bool
- parseScalarValueColumnTypeWithContext :: forall m b. (MonadError QErr m, Backend b) => ScalarTypeParsingContext b -> ColumnType b -> Value -> m (ScalarValue b)
- parseScalarValueColumnType :: forall m b r. (MonadError QErr m, Backend b, MonadReader r m, Has (ScalarTypeParsingContext b) r) => ColumnType b -> Value -> m (ScalarValue b)
- parseScalarValuesColumnTypeWithContext :: forall m b. (MonadError QErr m, Backend b) => ScalarTypeParsingContext b -> ColumnType b -> [Value] -> m [ScalarValue b]
- parseScalarValuesColumnType :: forall m b r. (MonadError QErr m, Backend b, MonadReader r m, Has (ScalarTypeParsingContext b) r) => ColumnType b -> [Value] -> m [ScalarValue b]
- data RawColumnType (b :: BackendType)
- data RawColumnInfo (b :: BackendType) = RawColumnInfo {}
- data ColumnMutability = ColumnMutability {}
- data ColumnInfo (b :: BackendType) = ColumnInfo {
- ciColumn :: Column b
- ciName :: Name
- ciPosition :: Int
- ciType :: ColumnType b
- ciIsNullable :: Bool
- ciDescription :: Maybe Description
- ciMutability :: ColumnMutability
- data NestedObjectInfo b = NestedObjectInfo {}
- data NestedArrayInfo b = NestedArrayInfo {}
- data StructuredColumnInfo b
- structuredColumnInfoName :: StructuredColumnInfo b -> Name
- structuredColumnInfoColumn :: StructuredColumnInfo b -> Column b
- structuredColumnInfoMutability :: StructuredColumnInfo b -> ColumnMutability
- toScalarColumnInfo :: StructuredColumnInfo b -> Maybe (ColumnInfo b)
- _SCIArrayColumn :: forall b. Prism' (StructuredColumnInfo b) (NestedArrayInfo b)
- _SCIObjectColumn :: forall b. Prism' (StructuredColumnInfo b) (NestedObjectInfo b)
- _SCIScalarColumn :: forall b. Prism' (StructuredColumnInfo b) (ColumnInfo b)
- type PrimaryKeyColumns b = NESeq (ColumnInfo b)
- onlyNumCols :: forall b. Backend b => [ColumnInfo b] -> [ColumnInfo b]
- isNumCol :: forall b. Backend b => ColumnInfo b -> Bool
- onlyComparableCols :: forall b. Backend b => [ColumnInfo b] -> [ColumnInfo b]
- isComparableCol :: forall b. Backend b => ColumnInfo b -> Bool
- getColInfos :: Backend b => [Column b] -> [ColumnInfo b] -> [ColumnInfo b]
- fromCol :: Backend b => Column b -> FieldName
- type ColumnValues b a = HashMap (Column b) a
- data ColumnReference (b :: BackendType)
- columnReferenceNullable :: ColumnReference (b :: BackendType) -> Maybe Bool
- columnReferenceType :: ColumnReference backend -> ColumnType backend
Documentation
Instances
FromJSON EnumValue Source # | |
FromJSONKey EnumValue Source # | |
ToJSON EnumValue Source # | |
ToJSONKey EnumValue Source # | |
Defined in Hasura.RQL.Types.Column | |
Generic EnumValue Source # | |
Show EnumValue Source # | |
NFData EnumValue Source # | |
Defined in Hasura.RQL.Types.Column | |
Eq EnumValue Source # | |
Ord EnumValue Source # | |
Defined in Hasura.RQL.Types.Column | |
Hashable EnumValue Source # | |
type Rep EnumValue Source # | |
Defined in Hasura.RQL.Types.Column |
newtype EnumValueInfo Source #
Instances
type EnumValues = HashMap EnumValue EnumValueInfo Source #
data EnumReference (b :: BackendType) Source #
Represents a reference to an “enum table,” a single-column Postgres table that is referenced via foreign key.
Instances
data ColumnType (b :: BackendType) Source #
The type we use for columns, which are currently always “scalars” (though
see the note about CollectableType
). Unlike ScalarType
, which represents
a type that a backend knows about, this type characterizes distinctions we
make but the backend doesn’t.
ColumnScalar (ScalarType b) | Ordinary Postgres columns. |
ColumnEnumReference (EnumReference b) | Columns that reference enum tables (see Hasura.RQL.Schema.Enum). This is not actually a
distinct type from the perspective of Postgres (at the time of this writing, we ensure they
always have type |
Instances
_ColumnEnumReference :: forall b. Prism' (ColumnType b) (EnumReference b) Source #
_ColumnScalar :: forall b. Prism' (ColumnType b) (ScalarType b) Source #
type ValueParser b m v = CollectableType (ColumnType b) -> Value -> m v Source #
A parser to parse a json value with enforcing column type
data ColumnValue (b :: BackendType) Source #
ColumnValue | |
|
Instances
Backend b => Show (ColumnValue b) Source # | |
Defined in Hasura.RQL.Types.Column showsPrec :: Int -> ColumnValue b -> ShowS # show :: ColumnValue b -> String # showList :: [ColumnValue b] -> ShowS # | |
Backend b => Eq (ColumnValue b) Source # | |
Defined in Hasura.RQL.Types.Column (==) :: ColumnValue b -> ColumnValue b -> Bool # (/=) :: ColumnValue b -> ColumnValue b -> Bool # |
isScalarColumnWhere :: (ScalarType b -> Bool) -> ColumnType b -> Bool Source #
isEnumColumn :: ColumnType b -> Bool Source #
parseScalarValueColumnTypeWithContext :: forall m b. (MonadError QErr m, Backend b) => ScalarTypeParsingContext b -> ColumnType b -> Value -> m (ScalarValue b) Source #
Note: Unconditionally accepts null values and returns PGNull
.
parseScalarValueColumnType :: forall m b r. (MonadError QErr m, Backend b, MonadReader r m, Has (ScalarTypeParsingContext b) r) => ColumnType b -> Value -> m (ScalarValue b) Source #
Note: Unconditionally accepts null values and returns PGNull
.
parseScalarValuesColumnTypeWithContext :: forall m b. (MonadError QErr m, Backend b) => ScalarTypeParsingContext b -> ColumnType b -> [Value] -> m [ScalarValue b] Source #
parseScalarValuesColumnType :: forall m b r. (MonadError QErr m, Backend b, MonadReader r m, Has (ScalarTypeParsingContext b) r) => ColumnType b -> [Value] -> m [ScalarValue b] Source #
data RawColumnType (b :: BackendType) Source #
RawColumnTypeScalar (ScalarType b) | |
RawColumnTypeObject (XNestedObjects b) Name | |
RawColumnTypeArray (XNestedObjects b) (RawColumnType b) Bool |
Instances
data RawColumnInfo (b :: BackendType) Source #
“Raw” column info, as stored in the catalog (but not in the schema cache). Instead of
containing a PGColumnType
, it only contains a PGScalarType
, which is combined with the
pcirReferences
field and other table data to eventually resolve the type to a PGColumnType
.
RawColumnInfo | |
|
Instances
data ColumnMutability Source #
Indicates whether a column may participate in certain mutations.
For example, identity columns may sometimes be insertable but rarely updatable, depending on the backend and how they're declared.
This guides the schema parsers such that they only generate fields for columns where they're valid without having to model the exact circumstances which cause a column to appear or not.
See https://github.com/hasura/graphql-engine/blob/master/rfcs/column-mutability.md.
Instances
data ColumnInfo (b :: BackendType) Source #
“Resolved” column info, produced from a RawColumnInfo
value that has been combined with
other schema information to produce a PGColumnType
.
ColumnInfo | |
|
Instances
data NestedObjectInfo b Source #
Instances
data NestedArrayInfo b Source #
Instances
data StructuredColumnInfo b Source #
SCIScalarColumn (ColumnInfo b) | |
SCIObjectColumn (NestedObjectInfo b) | |
SCIArrayColumn (NestedArrayInfo b) |
Instances
toScalarColumnInfo :: StructuredColumnInfo b -> Maybe (ColumnInfo b) Source #
_SCIArrayColumn :: forall b. Prism' (StructuredColumnInfo b) (NestedArrayInfo b) Source #
_SCIObjectColumn :: forall b. Prism' (StructuredColumnInfo b) (NestedObjectInfo b) Source #
_SCIScalarColumn :: forall b. Prism' (StructuredColumnInfo b) (ColumnInfo b) Source #
type PrimaryKeyColumns b = NESeq (ColumnInfo b) Source #
onlyNumCols :: forall b. Backend b => [ColumnInfo b] -> [ColumnInfo b] Source #
onlyComparableCols :: forall b. Backend b => [ColumnInfo b] -> [ColumnInfo b] Source #
isComparableCol :: forall b. Backend b => ColumnInfo b -> Bool Source #
getColInfos :: Backend b => [Column b] -> [ColumnInfo b] -> [ColumnInfo b] Source #
type ColumnValues b a = HashMap (Column b) a Source #
data ColumnReference (b :: BackendType) Source #
Represents a reference to a source column, possibly casted an arbitrary
number of times. Used within parseBoolExpOperations
for bookkeeping.
ColumnReferenceColumn (ColumnInfo b) | |
ColumnReferenceComputedField ComputedFieldName (ScalarType b) | |
ColumnReferenceCast (ColumnReference b) (ColumnType b) |
Instances
Backend b => ToTxt (ColumnReference b) Source # | |
Defined in Hasura.RQL.Types.Column toTxt :: ColumnReference b -> Text Source # |
columnReferenceNullable :: ColumnReference (b :: BackendType) -> Maybe Bool Source #
Whether the column referred to might be null. Currently we can only tell for references that refer to proper relation columns.
columnReferenceType :: ColumnReference backend -> ColumnType backend Source #