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

Hasura.SQL.Backend

Synopsis

Documentation

data PostgresKind Source #

Argument to Postgres; we represent backends which are variations on Postgres as sub-types of Postgres. This value indicates which "flavour" of Postgres a backend is.

Constructors

Vanilla 
Citus 
Cockroach 

Instances

Instances details
Eq PostgresKind Source # 
Instance details

Defined in Hasura.SQL.Backend

Ord PostgresKind Source # 
Instance details

Defined in Hasura.SQL.Backend

Show PostgresKind Source # 
Instance details

Defined in Hasura.SQL.Backend

Generic PostgresKind Source # 
Instance details

Defined in Hasura.SQL.Backend

Associated Types

type Rep PostgresKind :: Type -> Type #

Hashable PostgresKind Source # 
Instance details

Defined in Hasura.SQL.Backend

Cacheable PostgresKind Source # 
Instance details

Defined in Hasura.SQL.Backend

type Rep PostgresKind Source # 
Instance details

Defined in Hasura.SQL.Backend

type Rep PostgresKind = D1 ('MetaData "PostgresKind" "Hasura.SQL.Backend" "graphql-engine-1.0.0-inplace" 'False) (C1 ('MetaCons "Vanilla" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Citus" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cockroach" 'PrefixI 'False) (U1 :: Type -> Type)))

data BackendType Source #

An enum that represents each backend we support.

Instances

Instances details
Eq BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

Ord BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

Show BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

Generic BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

Associated Types

type Rep BackendType :: Type -> Type #

Hashable BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

FromJSON BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser BackendType

parseJSONList :: Value -> Parser [BackendType]

ToJSON BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

toJSON :: BackendType -> Value

toEncoding :: BackendType -> Encoding

toJSONList :: [BackendType] -> Value

toEncodingList :: [BackendType] -> Encoding

ToTxt BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

toTxt :: BackendType -> Text Source #

Cacheable BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

From BackendType NonEmptyText Source #

The name of the backend, as we expect it to appear in our metadata and API.

Instance details

Defined in Hasura.SQL.Backend

Cacheable (Proxy b) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

unchanged :: Accesses -> Proxy b -> Proxy b -> Bool Source #

type Rep BackendType Source # 
Instance details

Defined in Hasura.SQL.Backend

type Rep BackendType = D1 ('MetaData "BackendType" "Hasura.SQL.Backend" "graphql-engine-1.0.0-inplace" 'False) ((C1 ('MetaCons "Postgres" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PostgresKind)) :+: C1 ('MetaCons "MSSQL" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "BigQuery" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "MySQL" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "DataConnector" 'PrefixI 'False) (U1 :: Type -> Type))))

data BackendSourceKind (b :: BackendType) where Source #

Similar to BackendType, however, in the case of DataConnectorKind we need to be able capture the name of the data connector that should be used by the DataConnector backend. This type correlates to the kind property of SourceMetadata, which is usually just postgres, mssql, etc for static backends, but can be a configurable value for DataConnector hence requiring DataConnectorName for DataConnectorKind

This type cannot entirely replace BackendType because BackendType has a fixed number of possible values which can be enumerated over at compile time, but BackendSourceKind does not because DataConnector fundamentally is configured at runtime with DataConnectorName.

Instances

Instances details
Eq (BackendSourceKind b) Source # 
Instance details

Defined in Hasura.SQL.Backend

Ord (BackendSourceKind b) Source # 
Instance details

Defined in Hasura.SQL.Backend

Show (BackendSourceKind b) Source # 
Instance details

Defined in Hasura.SQL.Backend

HasCodec (BackendSourceKind ('Postgres 'Vanilla)) Source # 
Instance details

Defined in Hasura.SQL.Backend

HasCodec (BackendSourceKind ('Postgres 'Citus)) Source # 
Instance details

Defined in Hasura.SQL.Backend

HasCodec (BackendSourceKind ('Postgres 'Cockroach)) Source # 
Instance details

Defined in Hasura.SQL.Backend

HasCodec (BackendSourceKind 'MSSQL) Source # 
Instance details

Defined in Hasura.SQL.Backend

HasCodec (BackendSourceKind 'BigQuery) Source # 
Instance details

Defined in Hasura.SQL.Backend

HasCodec (BackendSourceKind 'MySQL) Source # 
Instance details

Defined in Hasura.SQL.Backend

HasCodec (BackendSourceKind 'DataConnector) Source # 
Instance details

Defined in Hasura.SQL.Backend

FromJSON (BackendSourceKind ('Postgres 'Vanilla)) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser (BackendSourceKind ('Postgres 'Vanilla))

parseJSONList :: Value -> Parser [BackendSourceKind ('Postgres 'Vanilla)]

FromJSON (BackendSourceKind ('Postgres 'Citus)) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser (BackendSourceKind ('Postgres 'Citus))

parseJSONList :: Value -> Parser [BackendSourceKind ('Postgres 'Citus)]

FromJSON (BackendSourceKind ('Postgres 'Cockroach)) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser (BackendSourceKind ('Postgres 'Cockroach))

parseJSONList :: Value -> Parser [BackendSourceKind ('Postgres 'Cockroach)]

FromJSON (BackendSourceKind 'MSSQL) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser (BackendSourceKind 'MSSQL)

parseJSONList :: Value -> Parser [BackendSourceKind 'MSSQL]

FromJSON (BackendSourceKind 'BigQuery) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser (BackendSourceKind 'BigQuery)

parseJSONList :: Value -> Parser [BackendSourceKind 'BigQuery]

FromJSON (BackendSourceKind 'MySQL) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser (BackendSourceKind 'MySQL)

parseJSONList :: Value -> Parser [BackendSourceKind 'MySQL]

FromJSON (BackendSourceKind 'DataConnector) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

parseJSON :: Value -> Parser (BackendSourceKind 'DataConnector)

parseJSONList :: Value -> Parser [BackendSourceKind 'DataConnector]

ToJSON (BackendSourceKind b) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

toJSON :: BackendSourceKind b -> Value

toEncoding :: BackendSourceKind b -> Encoding

toJSONList :: [BackendSourceKind b] -> Value

toEncodingList :: [BackendSourceKind b] -> Encoding

ToTxt (BackendSourceKind b) Source # 
Instance details

Defined in Hasura.SQL.Backend

Methods

toTxt :: BackendSourceKind b -> Text Source #

Cacheable (BackendSourceKind b) Source # 
Instance details

Defined in Hasura.SQL.Backend

From (BackendSourceKind b) NonEmptyText Source # 
Instance details

Defined in Hasura.SQL.Backend

Backend b => FromJSONWithContext (BackendSourceKind b) (SourceMetadata b) Source # 
Instance details

Defined in Hasura.RQL.Types.Metadata.Common

Methods

parseJSONWithContext :: BackendSourceKind b -> Value -> Parser (SourceMetadata b) Source #

Backend b => FromJSONWithContext (BackendSourceKind b) (AddSource b) Source # 
Instance details

Defined in Hasura.RQL.DDL.Schema.Source

Methods

parseJSONWithContext :: BackendSourceKind b -> Value -> Parser (AddSource b) Source #

Backend b => FromJSONWithContext (BackendSourceKind b) (UpdateSource b) Source # 
Instance details

Defined in Hasura.RQL.DDL.Schema.Source

Methods

parseJSONWithContext :: BackendSourceKind b -> Value -> Parser (UpdateSource b) Source #

backendShortName :: BackendType -> Maybe Text Source #

Some generated APIs use a shortened version of the backend's name rather than its full name. This function returns the "short form" of a backend, if any.

backendTypeFromText :: Text -> Maybe BackendType Source #

This uses this lookup mechanism to avoid having to duplicate and hardcode the backend string. We accept both the short form and the long form of the backend's name.