| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Hasura.RQL.Types.Column
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
- parseScalarValueColumnType :: forall m b. (MonadError QErr m, Backend b) => ColumnType b -> Value -> m (ScalarValue b)
- parseScalarValuesColumnType :: (MonadError QErr m, Backend b) => ColumnType b -> [Value] -> m [ScalarValue b]
- data RawColumnInfo (b :: BackendType) = RawColumnInfo {
- rciName :: Column b
- rciPosition :: Int
- rciType :: ScalarType b
- rciIsNullable :: Bool
- rciDescription :: Maybe Description
- rciMutability :: ColumnMutability
- 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
- 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]
- 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)
- columnReferenceType :: ColumnReference backend -> ColumnType backend
Documentation
Constructors
| EnumValue | |
Fields
| |
Instances
| Eq EnumValue Source # | |
| Ord EnumValue Source # | |
| Show EnumValue Source # | |
| NFData EnumValue Source # | |
Defined in Hasura.RQL.Types.Column | |
| Hashable EnumValue Source # | |
Defined in Hasura.RQL.Types.Column | |
| FromJSONKey EnumValue Source # | |
Defined in Hasura.RQL.Types.Column Methods fromJSONKey :: FromJSONKeyFunction EnumValue fromJSONKeyList :: FromJSONKeyFunction [EnumValue] | |
| FromJSON EnumValue Source # | |
Defined in Hasura.RQL.Types.Column | |
| ToJSONKey EnumValue Source # | |
Defined in Hasura.RQL.Types.Column | |
| ToJSON EnumValue Source # | |
Defined in Hasura.RQL.Types.Column Methods toEncoding :: EnumValue -> Encoding toJSONList :: [EnumValue] -> Value toEncodingList :: [EnumValue] -> Encoding | |
| Cacheable EnumValue Source # | |
newtype EnumValueInfo Source #
Constructors
| EnumValueInfo | |
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.
Constructors
| EnumReference | |
Fields
| |
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.
Constructors
| 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 #
Constructors
| ColumnValue | |
Fields
| |
Instances
| (Backend b, Eq (ScalarValue b)) => Eq (ColumnValue b) Source # | |
Defined in Hasura.RQL.Types.Column Methods (==) :: ColumnValue b -> ColumnValue b -> Bool # (/=) :: ColumnValue b -> ColumnValue b -> Bool # | |
| (Backend b, Show (ScalarValue b)) => Show (ColumnValue b) Source # | |
Defined in Hasura.RQL.Types.Column Methods showsPrec :: Int -> ColumnValue b -> ShowS # show :: ColumnValue b -> String # showList :: [ColumnValue b] -> ShowS # | |
isScalarColumnWhere :: (ScalarType b -> Bool) -> ColumnType b -> Bool Source #
isEnumColumn :: ColumnType b -> Bool Source #
parseScalarValueColumnType :: forall m b. (MonadError QErr m, Backend b) => ColumnType b -> Value -> m (ScalarValue b) Source #
Note: Unconditionally accepts null values and returns PGNull.
parseScalarValuesColumnType :: (MonadError QErr m, Backend b) => ColumnType b -> [Value] -> m [ScalarValue b] Source #
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.
Constructors
| RawColumnInfo | |
Fields
| |
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.
Constructors
| ColumnMutability | |
Fields | |
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.
Constructors
| ColumnInfo | |
Fields
| |
Instances
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 #
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.
Constructors
| 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 Methods toTxt :: ColumnReference b -> Text Source # | |
columnReferenceType :: ColumnReference backend -> ColumnType backend Source #