1
Fork 0
mirror of https://github.com/Airsequel/AirGQL.git synced 2025-07-27 02:18:43 +03:00

Fix "database or disk is full" errors

This commit is contained in:
prescientmoon 2024-09-30 23:22:19 +02:00
parent d3378c7ecd
commit faf63f0c6d
3 changed files with 5 additions and 7 deletions
source/AirGQL

View file

@ -1657,7 +1657,7 @@ getDerivedSchema
-> [TableEntryRaw]
-> IO (Schema IO)
getDerivedSchema schemaConf connection dbId tables = do
sqlitePragmas <- getSQLitePragmas schemaConf.pragmaConf
let sqlitePragmas = getSQLitePragmas schemaConf.pragmaConf
P.forM_ sqlitePragmas (execute_ connection)
queries <- queryType connection schemaConf.accessMode dbId tables

View file

@ -117,7 +117,7 @@ sqlQueryPostHandler pragmaConf dbId sqlPost = do
defaultConfig.sqlTimeoutTime
* microsecondsPerSecond
sqlitePragmas <- liftIO $ getSQLitePragmas pragmaConf
let sqlitePragmas = getSQLitePragmas pragmaConf
let
performSqlOperations =

View file

@ -36,13 +36,12 @@ defaultConf =
-- | Get the SQLite pragmas to use for a database
getSQLitePragmas :: PragmaConf -> IO [SS.Query]
getSQLitePragmas pragConf = do
getSQLitePragmas :: PragmaConf -> [SS.Query]
getSQLitePragmas pragConf =
let
getPrag key value =
SS.Query $ "PRAGMA " <> key <> " = " <> value
pure
in
[ getPrag "case_sensitive_like" "True"
, getPrag "foreign_keys" "True"
, -- TODO: Check if this really works
@ -50,7 +49,6 @@ getSQLitePragmas pragConf = do
, getPrag "max_page_count" $ show @Int pragConf.maxPageCount
, getPrag "recursive_triggers" $ show @Bool pragConf.allowRecursTrig
, -- TODO: Reactivate after https://sqlite.org/forum/forumpost/d7b9a365e0
-- (Also activate in SqlQuery.hs)
-- , getPrag "trusted_schema" "False"
getPrag "writable_schema" "False"
]