Skip to content

Commit 0056a8f

Browse files
committed
Include a note about db routers in QE topic guide
1 parent 370dd18 commit 0056a8f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/topics/queryable-encryption.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,24 @@ model data. The fields will automatically handle encryption and decryption,
7777
ensuring that :ref:`sensitive data is stored securely in the database
7878
<manual:qe-features-encryption-at-rest>`.
7979

80+
Routers
81+
-------
82+
83+
The example above requires a :ref:`database router
84+
<qe-configuring-database-routers-setting>` to direct operations on models with
85+
encrypted fields to the appropriate database. It also requires the use of a
86+
:ref:`router for embedded models <configuring-database-routers-setting>`. Here
87+
is an example that includes both:
88+
89+
.. code-block:: python
90+
91+
# myproject/settings.py
92+
DATABASE_ROUTERS = [
93+
"django_mongodb_backend.routers.MongoRouter",
94+
"myproject.routers.EncryptedRouter",
95+
]
96+
97+
8098
Querying encrypted fields
8199
-------------------------
82100

0 commit comments

Comments
 (0)