1
Fork 0
mirror of https://github.com/Airsequel/AirGQL.git synced 2025-08-13 10:16:57 +03:00

Remove commented out code from graphiql playground component

Also make it so `_by_pk` is only disallowed as a table suffix, not infix
This commit is contained in:
prescientmoon 2024-11-15 16:14:34 +01:00
commit 9088c8fd05

View file

@ -74,7 +74,7 @@ import Control.Monad.Catch (catchAll)
import Data.Aeson (FromJSON, ToJSON, Value (Bool, Null, Number, Object, String))
import Data.Aeson.KeyMap qualified as KeyMap
import Data.Scientific qualified as Scientific
import Data.Text (isInfixOf, toUpper)
import Data.Text (isInfixOf, isSuffixOf, toUpper)
import Data.Text qualified as T
import Database.SQLite.Simple (
Connection,
@ -737,7 +737,7 @@ lintTable allEntries parsed =
illegalName = case parsed.statement of
CreateTable names _ _
| Just name <- getFirstName (Just names)
, "_by_pk" `isInfixOf` name ->
, "_by_pk" `isSuffixOf` name ->
pure $
"Table names shouldn't contain \"_by_pk\", yet \""
<> name