remove the PRAGMAs and comment block, should work
remove the PRAGMAs and comment block, should work
WAL provides more concurrency as readers do not block writers and a writer does not block readers. Reading and writing can proceed concurrently.https://www.sqlite.org/wal.html


D1_ERROR: Failed to parse body as JSON i get randomly on my query

const sqlQuery = env.DB.prepare(
`SELECT * FROM Resources WHERE resource_id = ? and account_id = ?`
).bind(resourceId, authUser.account_id);
const resource = await sqlQuery.first<Resource>();MERGE INTO pt_player_tribe AS target
USING (SELECT ?1 AS player_id, ?2 AS tribe_id, ?3 AS world) AS source
ON (target.player_id = source.player_id AND target.world = source.world)
WHEN MATCHED AND target.tribe_id <> source.tribe_id THEN
UPDATE SET tribe_id = source.tribe_id
WHEN NOT MATCHED THEN
INSERT (player_id, world, tribe_id)
VALUES (source.player_id, source.world, source.tribe_id);