Safe Haskell | None |
---|---|
Language | Haskell2010 |
BackendAPI
This module defines the BackendAPI
class, alongside a few helpers. Its goal is to delegate to
backends the responsibility of creating the parsers for the metadata API. Each backend is expected
to provide a list of CommandParser
, which in turn is a simple function from command name and
command arguments to a corresponding parser. Command parsers can easily be created using the
commandParser
function.
Furthermore, for each set of related features, such as table tracking commands, or permission commands, a helper function is provided, that allows a backend to write its instance by simply listing the set of features it supports.
Documentation
type CommandParser b = BackendSourceKind b -> Text -> Value -> Parser (Maybe RQLMetadataV1) Source #
class BackendAPI (b :: BackendType) where Source #
Instances
BackendAPI 'MSSQL Source # | |
Defined in Hasura.Backends.MSSQL.Instances.API | |
BackendAPI 'BigQuery Source # | |
BackendAPI 'MySQL Source # | |
Defined in Hasura.Backends.MySQL.Instances.API | |
BackendAPI 'DataConnector Source # | |
BackendAPI ('Postgres 'Vanilla) Source # | |
Defined in Hasura.Backends.Postgres.Instances.API | |
BackendAPI ('Postgres 'Citus) Source # | |
Defined in Hasura.Backends.Postgres.Instances.API | |
BackendAPI ('Postgres 'Cockroach) Source # | |
Defined in Hasura.Backends.Postgres.Instances.API |
commandParserWithExplicitParser Source #
:: (BackendSourceKind b -> Value -> Parser a) | Explicit parsing function that also takes a BackendKind |
-> Text | expected command name |
-> (a -> RQLMetadataV1) | corresponding parser |
-> CommandParser b |
:: FromJSON a | |
=> Text | expected command name |
-> (a -> RQLMetadataV1) | corresponding parser |
-> CommandParser b |
commandParserWithBackendKind Source #
:: FromJSONWithContext (BackendSourceKind b) a | |
=> Text | expected command name |
-> (a -> RQLMetadataV1) | corresponding parser |
-> CommandParser b |
sourceCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
tableCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
tablePermissionsCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
functionCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
functionPermissionsCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
relationshipCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
remoteRelationshipCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
eventTriggerCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #
computedFieldCommands :: forall (b :: BackendType). Backend b => [CommandParser b] Source #