Safe Haskell | Safe-Inferred |
---|---|
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
- DataConnectorKind :: DataConnectorName -> BackendSourceKind 'DataConnector
- backendShortName :: BackendType -> Maybe Text
- supportedBackends :: [BackendType]
- backendTextNames :: BackendType -> [Text]
- 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
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 #
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.