server/citus: fix Citus runSQL never rebuilding the schema cache (#1549)

### Description

RunSQL commands are analyzed to detect whether they require a schema cache rebuild; in the case of Citus we were always returning `False`. This PR fixes this, and also removes the catch-all case, to make it explicit / obvious whenever we change this.

https://github.com/hasura/graphql-engine-mono/pull/1549

GitOrigin-RevId: dddaaea868e7b7999bdfe11451032df9d9b44274
This commit is contained in:
Antoine Leblanc 2021-06-11 12:38:03 +01:00 committed by hasura-bot
parent e8e4f30dd6
commit 5105cba829

View File

@ -98,10 +98,17 @@ runQuery env instanceId userInfo schemaCache httpManager serverConfigCtx rqlQuer
queryModifiesSchema :: RQLQuery -> Bool
queryModifiesSchema = \case
RQRunSql q -> Postgres.isSchemaCacheBuildRequiredRunSQL q
RQMssqlRunSql q -> MSSQL.sqlContainsDDLKeyword $ MSSQL._mrsSql q
RQBulk l -> any queryModifiesSchema l
_ -> False
RQInsert _ -> False
RQSelect _ -> False
RQUpdate _ -> False
RQDelete _ -> False
RQCount _ -> False
RQRunSql q -> Postgres.isSchemaCacheBuildRequiredRunSQL q
RQCitusRunSql q -> Postgres.isSchemaCacheBuildRequiredRunSQL q
RQMssqlRunSql q -> MSSQL.sqlContainsDDLKeyword $ MSSQL._mrsSql q
RQBigqueryRunSql _ -> False
RQBigqueryDatabaseInspection _ -> False
RQBulk l -> any queryModifiesSchema l
runQueryM
:: ( HasVersion