summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAaron Linville <aaron@linville.org>2023-08-17 18:06:25 -0400
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2024-02-16 12:59:19 +0100
commit7a05b8a2fac57e32a61726893d4601352c1d1c8d (patch)
tree186513f0f28bad17ced097853358e72609415ac5 /docs
parent66e47ac69a7e71cf32eee312d05668d8f1ba24bb (diff)
Fixed #24018 -- Allowed setting pragma options on SQLite.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/databases.txt24
-rw-r--r--docs/releases/5.1.txt7
-rw-r--r--docs/spelling_wordlist1
3 files changed, 32 insertions, 0 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index d853647730..1bc787671e 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -941,6 +941,30 @@ To enable the JSON1 extension you can follow the instruction on
.. _JSON1 extension: https://www.sqlite.org/json1.html
.. _the wiki page: https://code.djangoproject.com/wiki/JSON1Extension
+.. _sqlite-init-command:
+
+Setting pragma options
+----------------------
+
+.. versionadded:: 5.1
+
+`Pragma options`_ can be set upon connection by using the ``init_command`` in
+the :setting:`OPTIONS` part of your database configuration in
+:setting:`DATABASES`. The example below shows how to enable extra durability of
+synchronous writes and change the ``cache_size``::
+
+ DATABASES = {
+ "default": {
+ "ENGINE": "django.db.backends.sqlite3",
+ # ...
+ "OPTIONS": {
+ "init_command": "PRAGMA synchronous=3; PRAGMA cache_size=2000;",
+ },
+ }
+ }
+
+.. _Pragma options: https://www.sqlite.org/pragma.html
+
.. _oracle-notes:
Oracle notes
diff --git a/docs/releases/5.1.txt b/docs/releases/5.1.txt
index 94c342e8a0..e288bab20c 100644
--- a/docs/releases/5.1.txt
+++ b/docs/releases/5.1.txt
@@ -146,6 +146,13 @@ CSRF
* ...
+Database backends
+~~~~~~~~~~~~~~~~~
+
+* ``"init_command"`` option is now supported in :setting:`OPTIONS` on SQLite
+ to allow specifying :ref:`pragma options <sqlite-init-command>` to set upon
+ connection.
+
Decorators
~~~~~~~~~~
diff --git a/docs/spelling_wordlist b/docs/spelling_wordlist
index 5828b24253..1044cd80eb 100644
--- a/docs/spelling_wordlist
+++ b/docs/spelling_wordlist
@@ -361,6 +361,7 @@ postfix
postgis
postgres
postgresql
+pragma
pre
precisions
precomputation