mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-14 13:13:50 +01:00
Add docs on how to use synapse with psycopg2
This commit is contained in:
parent
6f8e2d517e
commit
56f518d279
1 changed files with 34 additions and 0 deletions
34
docs/postgres.rst
Normal file
34
docs/postgres.rst
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
Using Postgres
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Set up client
|
||||||
|
=============
|
||||||
|
We need to have installed the postgres python connector ``psycopg2``. In the
|
||||||
|
virtual env::
|
||||||
|
|
||||||
|
sudo apt-get install libpq-dev
|
||||||
|
pip install psycopg2
|
||||||
|
|
||||||
|
|
||||||
|
Synapse config
|
||||||
|
==============
|
||||||
|
|
||||||
|
Add the following line to your config file::
|
||||||
|
|
||||||
|
database_config: <db_config_file>
|
||||||
|
|
||||||
|
Where ``<db_config_file>`` is the file name that points to a yaml file of the
|
||||||
|
following form::
|
||||||
|
|
||||||
|
name: psycopg2
|
||||||
|
args:
|
||||||
|
user: <user>
|
||||||
|
password: <pass>
|
||||||
|
database: <db>
|
||||||
|
host: <host>
|
||||||
|
cp_min: 5
|
||||||
|
cp_max: 10
|
||||||
|
|
||||||
|
All key, values in ``args`` are passed to the ``psycopg2.connect(..)``
|
||||||
|
function, except keys beginning with ``cp_``, which are consumed by the twisted
|
||||||
|
adbapi connection pool.
|
Loading…
Reference in a new issue