From 9e5cb95e1f1e75db7c2c5cfad58bccd2e219831b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Thu, 24 Aug 2023 19:53:31 +0100 Subject: [PATCH] Documentation for Configuration.journalMode --- GRDB/Documentation.docc/DatabaseSharing.md | 8 +++++--- GRDB/Documentation.docc/Extension/Configuration.md | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/GRDB/Documentation.docc/DatabaseSharing.md b/GRDB/Documentation.docc/DatabaseSharing.md index b83f56e60..3cc64120e 100644 --- a/GRDB/Documentation.docc/DatabaseSharing.md +++ b/GRDB/Documentation.docc/DatabaseSharing.md @@ -21,11 +21,13 @@ We'll address all of those challenges below. > > Always consider sharing plain files, or any other inter-process communication technique, before sharing an SQLite database. -## Use a Database Pool +## Use the WAL mode -In order to access a shared database, use a ``DatabasePool``. It opens the database in the [WAL mode], which helps sharing a database. +In order to access a shared database, use a ``DatabasePool``. It opens the database in the [WAL mode], which helps sharing a database because it allows multiple processes to access the database concurrently. -Since several processes may open the database at the same time, protect the creation of the database pool with an [NSFileCoordinator]. +It is also possible to use a ``DatabaseQueue``, with the `.wal` ``Configuration/journalMode``. + +Since several processes may open the database at the same time, protect the creation of the database connection with an [NSFileCoordinator]. - In a process that can create and write in the database, use this sample code: diff --git a/GRDB/Documentation.docc/Extension/Configuration.md b/GRDB/Documentation.docc/Extension/Configuration.md index e2e4b2743..efb77b8a6 100644 --- a/GRDB/Documentation.docc/Extension/Configuration.md +++ b/GRDB/Documentation.docc/Extension/Configuration.md @@ -83,7 +83,9 @@ do { - ``acceptsDoubleQuotedStringLiterals`` - ``busyMode`` - ``foreignKeysEnabled`` +- ``journalMode`` - ``readonly`` +- ``JournalModeConfiguration`` ### Configuring GRDB Connections