summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-27 14:53:35 +0100
committerErik Johnston <erik@matrix.org>2015-04-27 14:53:35 +0100
commit56f518d279b642efce92e172b463232937d50b8c (patch)
treee3558b809273851fa4c3bb03225c974956228794
parentMerge branch 'develop' of github.com:matrix-org/synapse into postgres (diff)
downloadsynapse-56f518d279b642efce92e172b463232937d50b8c.tar.xz
Add docs on how to use synapse with psycopg2
-rw-r--r--docs/postgres.rst34
1 files changed, 34 insertions, 0 deletions
diff --git a/docs/postgres.rst b/docs/postgres.rst
new file mode 100644
index 0000000000..5bb45d3ed9
--- /dev/null
+++ b/docs/postgres.rst
@@ -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.