1
Fork 0
mirror of https://github.com/Airsequel/AirGQL.git synced 2025-07-10 08:54:54 +03:00
airgql/source/AirGQL/Config.hs

42 lines
976 B
Haskell

module AirGQL.Config (
Config (..),
maxGraphqlResultCount,
defaultConfig,
)
where
import Data.Bool (Bool (False))
import Data.Int (Int)
-- | The maximum number of results allowed for the GraphiQL playground
maxGraphqlResultCount :: Int
maxGraphqlResultCount = 10000
data Config = Config
{ maxTablesPerDb :: Int
, maxColumnsPerTable :: Int
, maxRowsPerTable :: Int
, maxVisibleCellsPerTable :: Int
, maxDbSize :: Int -- Bytes
, maxCellSize :: Int -- Bytes
, hardHeapLimit :: Int -- Bytes
, sqlTimeoutTime :: Int -- Seconds
, allowRecursiveTriggers :: Bool
}
defaultConfig :: Config
defaultConfig =
Config
{ maxTablesPerDb = 100
, maxColumnsPerTable = 500
, maxRowsPerTable = 100_000
, maxVisibleCellsPerTable = 0 -- Not used currently
, maxDbSize = 100_000_000 -- Bytes
, maxCellSize = 10_000_000 -- Bytes
, hardHeapLimit = 500_000_000 -- Bytes
, sqlTimeoutTime = 20
, allowRecursiveTriggers = False
}