From 75b8d49bed71a8f486bd37f5dd196786da3cfff8 Mon Sep 17 00:00:00 2001 From: "Gavin M. Roy" Date: Wed, 8 Apr 2020 18:22:24 -0400 Subject: [PATCH] Documentation updates --- docs/connector.rst | 4 ++-- docs/example.rst | 8 +++++--- docs/index.rst | 4 +++- docs/query_result.rst | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/connector.rst b/docs/connector.rst index 40d4811..95f062c 100644 --- a/docs/connector.rst +++ b/docs/connector.rst @@ -1,5 +1,5 @@ -PostgresConnector -================= +Postgres Connector +================== A :class:`~sprockets_postgres.PostgresConnector` instance contains a cursor for a Postgres connection and methods to execute queries. diff --git a/docs/example.rst b/docs/example.rst index c6bbfe1..d3c95bd 100644 --- a/docs/example.rst +++ b/docs/example.rst @@ -3,14 +3,13 @@ Example Web Application The following code provides a simple example for using the .. code-block:: python - + import sprockets.http import sprockets_postgres as postgres from sprockets.http import app - class RequestHandler(postgres.RequestHandlerMixin, - web.RequestHandler): + class RequestHandler(postgres.RequestHandlerMixin, web.RequestHandler): GET_SQL = """\ SELECT foo_id, bar, baz, qux @@ -29,6 +28,9 @@ The following code provides a simple example for using the setup the pool to connect to PostgreSQL and will shutdown the connections cleanly when the application stops. + It should be used in conjunction with ``sprockets.http.app.Application`` + and not directly with ``tornado.web.Application``. + """ diff --git a/docs/index.rst b/docs/index.rst index 9a503c3..087f454 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -5,13 +5,15 @@ in :class:`Tornado ` / :class:`sprockets.http ` applications using :py:mod:`aiopg`. +Python versions supported: 3.7+ + Installation ------------ ``sprockets-postgres`` is available on the Python package index and is installable via pip: .. code:: bash - pip install sprockets-postgres + pip3 install sprockets-postgres Documentation diff --git a/docs/query_result.rst b/docs/query_result.rst index 623dcc2..de1cb4f 100644 --- a/docs/query_result.rst +++ b/docs/query_result.rst @@ -1,5 +1,5 @@ -QueryResult -=========== +Query Result +============ A :class:`~sprockets_postgres.QueryResult` instance is created for every query and contains the count of rows effected by the query and either the ``row`` as a :class:`dict` or ``rows`` as a list of :class:`dict`. For queries that do