Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data PostgresKind
- data BackendType
- data BackendSourceKind (b :: BackendType) where
- PostgresVanillaKind :: BackendSourceKind ('Postgres 'Vanilla)
- PostgresCitusKind :: BackendSourceKind ('Postgres 'Citus)
- PostgresCockroachKind :: BackendSourceKind ('Postgres 'Cockroach)
- MSSQLKind :: BackendSourceKind 'MSSQL
- BigQueryKind :: BackendSourceKind 'BigQuery
- MySQLKind :: BackendSourceKind 'MySQL
- DataConnectorKind :: DataConnectorName -> BackendSourceKind 'DataConnector
- mkParseStaticBackendSourceKind :: BackendSourceKind b -> Value -> Parser (BackendSourceKind b)
- mkCodecStaticBackendSourceKind :: BackendSourceKind b -> JSONCodec (BackendSourceKind b)
- backendShortName :: BackendType -> Maybe Text
- supportedBackends :: [BackendType]
- backendTextNames :: BackendType -> [Text]
- backendTextNameLookup :: [(Text, BackendType)]
- backendTypeFromText :: Text -> Maybe BackendType
- parseBackendTypeFromText :: Text -> Parser BackendType
- backendTypeFromBackendSourceKind :: BackendSourceKind b -> BackendType
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.
Instances
data BackendType Source #
An enum that represents each backend we support.
Instances
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
mkParseStaticBackendSourceKind :: BackendSourceKind b -> Value -> Parser (BackendSourceKind b) Source #
mkCodecStaticBackendSourceKind :: BackendSourceKind b -> JSONCodec (BackendSourceKind 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.
backendTextNames :: BackendType -> [Text] Source #
backendTextNameLookup :: [(Text, BackendType)] Source #
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.
parseBackendTypeFromText :: Text -> Parser BackendType Source #