2021-07-07 04:43:42 +03:00
|
|
|
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
|
|
|
|
2022-02-08 12:24:34 +03:00
|
|
|
-- | Postgres Instances API
|
|
|
|
--
|
|
|
|
-- Defines a 'Hasura.Server.API.Backend.BackendAPI' type class instance for Postgres.
|
2021-11-04 19:08:33 +03:00
|
|
|
module Hasura.Backends.Postgres.Instances.API () where
|
2021-07-07 04:43:42 +03:00
|
|
|
|
|
|
|
import Hasura.Prelude
|
2022-10-11 12:08:04 +03:00
|
|
|
import Hasura.SQL.AnyBackend (mkAnyBackend)
|
2021-07-07 04:43:42 +03:00
|
|
|
import Hasura.SQL.Backend
|
|
|
|
import Hasura.Server.API.Backend
|
2023-04-17 15:09:54 +03:00
|
|
|
import Hasura.Server.API.Metadata.Types
|
2021-07-07 04:43:42 +03:00
|
|
|
|
|
|
|
instance BackendAPI ('Postgres 'Vanilla) where
|
|
|
|
metadataV1CommandParsers =
|
|
|
|
concat
|
|
|
|
[ sourceCommands @('Postgres 'Vanilla),
|
|
|
|
tableCommands @('Postgres 'Vanilla),
|
|
|
|
tablePermissionsCommands @('Postgres 'Vanilla),
|
|
|
|
functionCommands @('Postgres 'Vanilla),
|
|
|
|
functionPermissionsCommands @('Postgres 'Vanilla),
|
|
|
|
relationshipCommands @('Postgres 'Vanilla),
|
|
|
|
remoteRelationshipCommands @('Postgres 'Vanilla),
|
2021-09-06 14:15:36 +03:00
|
|
|
eventTriggerCommands @('Postgres 'Vanilla),
|
2022-05-04 17:52:29 +03:00
|
|
|
computedFieldCommands @('Postgres 'Vanilla),
|
2023-04-13 19:10:38 +03:00
|
|
|
nativeQueriesCommands @('Postgres 'Vanilla),
|
2023-04-19 12:03:36 +03:00
|
|
|
logicalModelsCommands @('Postgres 'Vanilla),
|
2022-10-11 12:08:04 +03:00
|
|
|
[ commandParser
|
|
|
|
"set_table_is_enum"
|
|
|
|
( RMPgSetTableIsEnum
|
|
|
|
. mkAnyBackend @('Postgres 'Vanilla)
|
|
|
|
)
|
2023-01-25 10:12:53 +03:00
|
|
|
],
|
|
|
|
connectionTemplateCommands @('Postgres 'Vanilla)
|
2021-07-07 04:43:42 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
instance BackendAPI ('Postgres 'Citus) where
|
|
|
|
metadataV1CommandParsers =
|
|
|
|
concat
|
|
|
|
[ sourceCommands @('Postgres 'Citus),
|
|
|
|
tableCommands @('Postgres 'Citus),
|
|
|
|
tablePermissionsCommands @('Postgres 'Citus),
|
|
|
|
functionCommands @('Postgres 'Citus),
|
|
|
|
functionPermissionsCommands @('Postgres 'Citus),
|
|
|
|
relationshipCommands @('Postgres 'Citus),
|
2023-01-25 10:12:53 +03:00
|
|
|
remoteRelationshipCommands @('Postgres 'Citus),
|
2023-03-17 14:26:45 +03:00
|
|
|
connectionTemplateCommands @('Postgres 'Citus),
|
2023-04-13 19:10:38 +03:00
|
|
|
nativeQueriesCommands @('Postgres 'Citus),
|
2023-04-19 12:03:36 +03:00
|
|
|
logicalModelsCommands @('Postgres 'Citus)
|
2021-07-07 04:43:42 +03:00
|
|
|
]
|
2022-08-19 17:19:54 +03:00
|
|
|
|
|
|
|
instance BackendAPI ('Postgres 'Cockroach) where
|
|
|
|
metadataV1CommandParsers =
|
|
|
|
concat
|
|
|
|
[ sourceCommands @('Postgres 'Cockroach),
|
|
|
|
tableCommands @('Postgres 'Cockroach),
|
|
|
|
tablePermissionsCommands @('Postgres 'Cockroach),
|
|
|
|
relationshipCommands @('Postgres 'Cockroach),
|
2022-10-11 12:08:04 +03:00
|
|
|
remoteRelationshipCommands @('Postgres 'Cockroach),
|
|
|
|
[ commandParser
|
|
|
|
"set_table_is_enum"
|
|
|
|
( RMPgSetTableIsEnum
|
|
|
|
. mkAnyBackend @('Postgres 'Cockroach)
|
|
|
|
)
|
2023-01-25 10:12:53 +03:00
|
|
|
],
|
2023-03-27 16:57:36 +03:00
|
|
|
connectionTemplateCommands @('Postgres 'Cockroach),
|
2023-04-13 19:10:38 +03:00
|
|
|
nativeQueriesCommands @('Postgres 'Cockroach),
|
2023-04-19 12:03:36 +03:00
|
|
|
logicalModelsCommands @('Postgres 'Cockroach)
|
2022-08-19 17:19:54 +03:00
|
|
|
]
|