Skip to content

Commit e97f93e

Browse files
chrisdonescriptnullqrilka
authored andcommitted
server/tests: run Haskell integration tests in CI
This PR introduces a BuildKite pipeline step to run the new hspec tests in CI. Closes hasura/graphql-engine-mono#2866 Relates to hasura#7760 PR-URL: hasura/graphql-engine-mono#2987 Co-authored-by: Vishnu Bharathi <4211715+scriptnull@users.noreply.github.com> Co-authored-by: Kirill Zaborsky <70110+qrilka@users.noreply.github.com> GitOrigin-RevId: 48cea2b81394ff1c4b19bd178ca10bbcb200f33e
1 parent eb427aa commit e97f93e

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

  • server/src-lib/Hasura/Backends/MySQL/Instances

‎server/src-lib/Hasura/Backends/MySQL/Instances/Schema.hs‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ instance BackendSchema 'MySQL where
4141
jsonPathArg = jsonPathArg'
4242
orderByOperators = orderByOperators'
4343
comparisonExps = comparisonExps'
44-
countTypeInput = error "countTypeInput: MySQL backend does not support this operation yet."
44+
countTypeInput = mysqlCountTypeInput
4545
aggregateOrderByCountType = error "aggregateOrderByCountType: MySQL backend does not support this operation yet."
4646
computedField = error "computedField: MySQL backend does not support this operation yet."
4747
node = error "node: MySQL backend does not support this operation yet."
@@ -284,3 +284,20 @@ comparisonExps' = P.memoize 'comparisonExps $ \columnType -> do
284284
offsetParser' :: MonadParse n => Parser 'Both n (SQLExpression 'MySQL)
285285
offsetParser' =
286286
MySQL.ValueExpression . MySQL.BigValue . fromIntegral <$> P.int
287+
288+
mysqlCountTypeInput ::
289+
MonadParse n =>
290+
Maybe (Parser 'Both n (Column 'MySQL)) ->
291+
InputFieldsParser n (IR.CountDistinct -> CountType 'MySQL)
292+
mysqlCountTypeInput = \case
293+
Just columnEnum -> do
294+
columns <- P.fieldOptional $$(G.litName "columns") Nothing $ P.list columnEnum
295+
pure $ flip mkCountType columns
296+
Nothing -> pure $ flip mkCountType Nothing
297+
where
298+
mkCountType :: IR.CountDistinct -> Maybe [Column 'MySQL] -> CountType 'MySQL
299+
mkCountType _ Nothing = MySQL.StarCountable
300+
mkCountType IR.SelectCountDistinct (Just cols) =
301+
maybe MySQL.StarCountable MySQL.DistinctCountable $ nonEmpty cols
302+
mkCountType IR.SelectCountNonDistinct (Just cols) =
303+
maybe MySQL.StarCountable MySQL.NonNullFieldCountable $ nonEmpty cols

0 commit comments

Comments
 (0)