graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Hasura.RQL.Types.Column

Synopsis

Documentation

newtype EnumValue Source #

Constructors

EnumValue 

Fields

Instances

Instances details
Eq EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Ord EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Show EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

NFData EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

rnf :: EnumValue -> () #

Hashable EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

FromJSONKey EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

fromJSONKey :: FromJSONKeyFunction EnumValue

fromJSONKeyList :: FromJSONKeyFunction [EnumValue]

FromJSON EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

parseJSON :: Value -> Parser EnumValue

parseJSONList :: Value -> Parser [EnumValue]

ToJSONKey EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toJSONKey :: ToJSONKeyFunction EnumValue

toJSONKeyList :: ToJSONKeyFunction [EnumValue]

ToJSON EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toJSON :: EnumValue -> Value

toEncoding :: EnumValue -> Encoding

toJSONList :: [EnumValue] -> Value

toEncodingList :: [EnumValue] -> Encoding

Cacheable EnumValue Source # 
Instance details

Defined in Hasura.RQL.Types.Column

newtype EnumValueInfo Source #

Constructors

EnumValueInfo 

Fields

Instances

Instances details
Eq EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Ord EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Show EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

NFData EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

rnf :: EnumValueInfo -> () #

Hashable EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

FromJSON EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

parseJSON :: Value -> Parser EnumValueInfo

parseJSONList :: Value -> Parser [EnumValueInfo]

ToJSON EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toJSON :: EnumValueInfo -> Value

toEncoding :: EnumValueInfo -> Encoding

toJSONList :: [EnumValueInfo] -> Value

toEncodingList :: [EnumValueInfo] -> Encoding

Cacheable EnumValueInfo Source # 
Instance details

Defined in Hasura.RQL.Types.Column

data EnumReference (b :: BackendType) Source #

Represents a reference to an “enum table,” a single-column Postgres table that is referenced via foreign key.

Instances

Instances details
Backend b => Eq (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Backend b => Ord (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Backend b => Show (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Generic (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Associated Types

type Rep (EnumReference b) :: Type -> Type #

Backend b => NFData (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

rnf :: EnumReference b -> () #

Backend b => Hashable (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Backend b => FromJSON (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

parseJSON :: Value -> Parser (EnumReference b)

parseJSONList :: Value -> Parser [EnumReference b]

Backend b => ToJSON (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toJSON :: EnumReference b -> Value

toEncoding :: EnumReference b -> Encoding

toJSONList :: [EnumReference b] -> Value

toEncodingList :: [EnumReference b] -> Encoding

Backend b => Cacheable (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep (EnumReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep (EnumReference b) = D1 ('MetaData "EnumReference" "Hasura.RQL.Types.Column" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "EnumReference" 'PrefixI 'True) (S1 ('MetaSel ('Just "erTable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (TableName b)) :*: (S1 ('MetaSel ('Just "erValues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 EnumValues) :*: S1 ('MetaSel ('Just "erTableCustomName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Name)))))

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 text), but we really want to distinguish this case, since we treat it completely differently in the GraphQL schema.

Instances

Instances details
Backend b => Eq (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

(==) :: ColumnType b -> ColumnType b -> Bool #

(/=) :: ColumnType b -> ColumnType b -> Bool #

Backend b => Ord (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Backend b => Show (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Generic (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Associated Types

type Rep (ColumnType b) :: Type -> Type #

Methods

from :: ColumnType b -> Rep (ColumnType b) x #

to :: Rep (ColumnType b) x -> ColumnType b #

Backend b => NFData (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

rnf :: ColumnType b -> () #

Backend b => Hashable (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

hashWithSalt :: Int -> ColumnType b -> Int

hash :: ColumnType b -> Int

Backend b => ToJSON (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toJSON :: ColumnType b -> Value

toEncoding :: ColumnType b -> Encoding

toJSONList :: [ColumnType b] -> Value

toEncodingList :: [ColumnType b] -> Encoding

Backend b => ToTxt (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toTxt :: ColumnType b -> Text Source #

Backend b => Cacheable (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep (ColumnType b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep (ColumnType b) = D1 ('MetaData "ColumnType" "Hasura.RQL.Types.Column" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "ColumnScalar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ScalarType b))) :+: C1 ('MetaCons "ColumnEnumReference" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (EnumReference b))))

_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 

Instances

Instances details
(Backend b, Eq (ScalarValue b)) => Eq (ColumnValue b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

(Backend b, Show (ScalarValue b)) => Show (ColumnValue b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

parseScalarValueColumnType :: forall m b. (MonadError QErr m, Backend b) => ColumnType b -> Value -> m (ScalarValue b) Source #

Note: Unconditionally accepts null values and returns PGNull.

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

Instances details
Backend b => Eq (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Backend b => Show (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Generic (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Associated Types

type Rep (RawColumnInfo b) :: Type -> Type #

Backend b => NFData (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

rnf :: RawColumnInfo b -> () #

Backend b => FromJSON (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

parseJSON :: Value -> Parser (RawColumnInfo b)

parseJSONList :: Value -> Parser [RawColumnInfo b]

Backend b => ToJSON (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toJSON :: RawColumnInfo b -> Value

toEncoding :: RawColumnInfo b -> Encoding

toJSONList :: [RawColumnInfo b] -> Value

toEncodingList :: [RawColumnInfo b] -> Encoding

Backend b => Cacheable (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep (RawColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep (RawColumnInfo b) = D1 ('MetaData "RawColumnInfo" "Hasura.RQL.Types.Column" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "RawColumnInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "rciName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Column b)) :*: (S1 ('MetaSel ('Just "rciPosition") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "rciType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ScalarType b)))) :*: (S1 ('MetaSel ('Just "rciIsNullable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "rciDescription") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Description)) :*: S1 ('MetaSel ('Just "rciMutability") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ColumnMutability)))))

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

Instances details
Eq ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Show ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Generic ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Associated Types

type Rep ColumnMutability :: Type -> Type #

NFData ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

rnf :: ColumnMutability -> () #

Hashable ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

FromJSON ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

parseJSON :: Value -> Parser ColumnMutability

parseJSONList :: Value -> Parser [ColumnMutability]

ToJSON ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Cacheable ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep ColumnMutability Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep ColumnMutability = D1 ('MetaData "ColumnMutability" "Hasura.RQL.Types.Column" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "ColumnMutability" 'PrefixI 'True) (S1 ('MetaSel ('Just "_cmIsInsertable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "_cmIsUpdatable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool)))

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

Instances details
Backend b => Eq (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

(==) :: ColumnInfo b -> ColumnInfo b -> Bool #

(/=) :: ColumnInfo b -> ColumnInfo b -> Bool #

Backend b => Show (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Generic (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Associated Types

type Rep (ColumnInfo b) :: Type -> Type #

Methods

from :: ColumnInfo b -> Rep (ColumnInfo b) x #

to :: Rep (ColumnInfo b) x -> ColumnInfo b #

Backend b => NFData (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

rnf :: ColumnInfo b -> () #

Backend b => Hashable (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

hashWithSalt :: Int -> ColumnInfo b -> Int

hash :: ColumnInfo b -> Int

Backend b => ToJSON (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toJSON :: ColumnInfo b -> Value

toEncoding :: ColumnInfo b -> Encoding

toJSONList :: [ColumnInfo b] -> Value

toEncodingList :: [ColumnInfo b] -> Encoding

Backend b => Cacheable (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

type Rep (ColumnInfo b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

onlyNumCols :: forall b. Backend b => [ColumnInfo b] -> [ColumnInfo b] Source #

isNumCol :: forall b. Backend b => ColumnInfo b -> Bool 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.

Instances

Instances details
Backend b => ToTxt (ColumnReference b) Source # 
Instance details

Defined in Hasura.RQL.Types.Column

Methods

toTxt :: ColumnReference b -> Text Source #