An asynchronous Postgres client mixin for Tornado applications
Find a file
2020-04-07 13:42:02 -04:00
.github/workflows Better conditional 2020-04-06 18:33:17 -04:00
.editorconfig Initial WIP commit 2020-04-06 17:39:52 -04:00
.gitignore Initial commit 2020-04-06 12:27:33 -04:00
bootstrap Initial WIP commit 2020-04-06 17:39:52 -04:00
docker-compose.yml Initial WIP commit 2020-04-06 17:39:52 -04:00
LICENSE Initial WIP commit 2020-04-06 17:39:52 -04:00
MANIFEST.in Include the VERSION file when packaging 2020-04-06 17:49:03 -04:00
README.rst README updates 2020-04-06 17:41:19 -04:00
setup.cfg Fix coverage report 2020-04-06 18:24:38 -04:00
setup.py Initial WIP commit 2020-04-06 17:39:52 -04:00
sprockets_postgres.py WIP refactor 2020-04-07 13:42:02 -04:00
tests.py WIP refactor 2020-04-07 13:42:02 -04:00
VERSION Move from a package to a module 2020-04-06 17:47:50 -04:00

Sprockets Postgres
==================
An asynchronous Postgres client mixin for Tornado applications

|Version| |Status| |Coverage| |License|

Installation
------------
``sprockets-postgres`` is available on the Python package index and is installable via pip:

.. code:: bash

    pip install sprockets-postgres

Documentation
-------------
Documentation is available at `sprockets-postgres.readthedocs.io <https://sprockets-postgres.readthedocs.io>`_.

Configuration
-------------
The following table details the environment variable configuration options:

+---------------------------------+--------------------------------------------------+---------------------------------+
| Variable                        | Definition                                       | Default                         |
+=================================+==================================================+=================================+
| ``PGSQL_URL``                   | The PostgreSQL URL to connect to                 | ``postgresql://localhost:5432`` |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_MAX_POOL_SIZE``      | Maximum connection count to Postgres per backend | ``0`` (Unlimited)               |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_MIN_POOL_SIZE``      | Minimum or starting pool size.                   | ``1``                           |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_CONNECTION_TIMEOUT`` | The maximum time in seconds to spend attempting  | ``10``                          |
|                                 | to create a new connection.                      |                                 |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_CONNECTION_TTL``     | Time-to-life in seconds for a pooled connection. | ``300``                         |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_QUERY_TIMEOUT``      | Maximum execution time for a query in seconds.   | ``60``                          |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_HSTORE``             | Enable HSTORE support in the client.             | ``FALSE``                       |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_JSON``               | Enable JSON support in the client.               | ``FALSE``                       |
+---------------------------------+--------------------------------------------------+---------------------------------+
| ``POSTGRES_UUID``               | Enable UUID support in the client.               | ``TRUE``                        |
+---------------------------------+--------------------------------------------------+---------------------------------+

Requirements
------------
- `aiopg <https://aioboto3.readthedocs.io/en/latest/>`_
- `sprockets.http <https://sprocketshttp.readthedocs.io/en/master/>`_
- `Tornado <https://tornadoweb.org>`_

Version History
---------------
Available at https://sprockets-postgres.readthedocs.org/en/latest/history.html

.. |Version| image:: https://img.shields.io/pypi/v/sprockets-postgres.svg?
   :target: http://badge.fury.io/py/sprockets-postgres

.. |Status| image:: https://img.shields.io/travis/sprockets/sprockets-postgres.svg?
   :target: https://travis-ci.org/sprockets/sprockets-postgres

.. |Coverage| image:: https://img.shields.io/codecov/c/github/sprockets/sprockets-postgres.svg?
   :target: https://codecov.io/github/sprockets/sprockets-postgres?branch=master

.. |License| image:: https://img.shields.io/pypi/l/sprockets-postgres.svg?
   :target: https://sprockets-postgres.readthedocs.org