server: enable runSQL for cockroach

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5629
Co-authored-by: Philip Lykke Carlsen <358550+plcplc@users.noreply.github.com>
GitOrigin-RevId: 617da541d1754289dc6097c46ec1de3fcc6b48f9
This commit is contained in:
Daniel Harvey 2022-08-25 14:30:34 +01:00 committed by hasura-bot
parent c0b7d14adc
commit d0ebb018e4
2 changed files with 5 additions and 2 deletions

View File

@ -48,8 +48,7 @@ runSetQueryTagsConfig (SetQueryTagsConfig sourceName queryTagsConfig) = do
Just exists -> do
let backendType = getBackendType exists
case backendType of
Postgres Vanilla -> setQueryTagsConfigInMetadata exists (Just queryTagsConfig)
Postgres Citus -> setQueryTagsConfigInMetadata exists (Just queryTagsConfig)
Postgres _ -> setQueryTagsConfigInMetadata exists (Just queryTagsConfig)
_ -> queryTagsNotSupported backendType
where
getBackendType :: BackendSourceMetadata -> BackendType

View File

@ -50,6 +50,7 @@ data RQLQuery
| RQRunSql !Postgres.RunSQL
| RQMssqlRunSql !MSSQL.MSSQLRunSQL
| RQCitusRunSql !Postgres.RunSQL
| RQCockroachRunSql !Postgres.RunSQL
| RQMysqlRunSql !MySQL.RunSQL
| RQBigqueryRunSql !BigQuery.BigQueryRunSQL
| RQBigqueryDatabaseInspection !BigQuery.BigQueryRunSQL
@ -122,6 +123,7 @@ queryModifiesSchema = \case
RQCount _ -> False
RQRunSql q -> Postgres.isSchemaCacheBuildRequiredRunSQL q
RQCitusRunSql q -> Postgres.isSchemaCacheBuildRequiredRunSQL q
RQCockroachRunSql q -> Postgres.isSchemaCacheBuildRequiredRunSQL q
RQMssqlRunSql q -> MSSQL.isSchemaCacheBuildRequiredRunSQL q
RQMysqlRunSql _ -> False
RQBigqueryRunSql _ -> False
@ -152,6 +154,7 @@ runQueryM env rq = Tracing.trace (T.pack $ constrName rq) $ case rq of
RQMssqlRunSql q -> MSSQL.runSQL q
RQMysqlRunSql q -> MySQL.runSQL q
RQCitusRunSql q -> Postgres.runRunSQL @'Citus q
RQCockroachRunSql q -> Postgres.runRunSQL @'Cockroach q
RQBigqueryRunSql q -> BigQuery.runSQL q
RQBigqueryDatabaseInspection q -> BigQuery.runDatabaseInspection q
RQBulk l -> encJFromList <$> indexedMapM (runQueryM env) l
@ -165,6 +168,7 @@ queryModifiesUserDB = \case
RQCount _ -> False
RQRunSql _ -> True
RQCitusRunSql _ -> True
RQCockroachRunSql _ -> True
RQMssqlRunSql _ -> True
RQMysqlRunSql _ -> True
RQBigqueryRunSql _ -> True