Skip to main content

An asynchronous Postgres client and mixin for Tornado applications

Project description

An set of mixins and classes for interacting with PostgreSQL using asyncio in Tornado / sprockets.http applications using aiopg.

Version Build Status Coverage License

Installation

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

pip install sprockets-postgres

Documentation

Documentation is available at sprockets-postgres.readthedocs.io.

Configuration

The following table details the environment variable configuration options:

Variable

Definition

Default

POSTGRES_URL

The PostgreSQL URL to connect to

POSTGRES_MAX_POOL_SIZE

Maximum connection count to Postgres per backend

10

POSTGRES_MIN_POOL_SIZE

Minimum or starting pool size.

1

POSTGRES_CONNECTION_TIMEOUT

The maximum time in seconds to spend attempting to create a new connection.

10

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

If POSTGRES_URL uses a scheme of postgresql+srv, a SRV DNS lookup will be performed and the lowest priority record with the highest weight will be selected for connecting to Postgres.

AWS’s ECS service discovery does not follow the SRV standard, but creates SRV records. If POSTGRES_URL uses a scheme of aws+srv, a SRV DNS lookup will be performed using the correct format for ECS service discovery. The lowest priority record with the highest weight will be selected for connecting to Postgres.

Requirements

Version History

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sprockets-postgres-1.4.1.tar.gz (10.8 kB view details)

Uploaded Source

File details

Details for the file sprockets-postgres-1.4.1.tar.gz.

File metadata

  • Download URL: sprockets-postgres-1.4.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for sprockets-postgres-1.4.1.tar.gz
Algorithm Hash digest
SHA256 d1e3be2c65791bb1ce7a083829b8f771c1ab71aae58cc1697e9d13b87a5b9a60
MD5 d5ba92135031cf8ead627dff9fa33f6b
BLAKE2b-256 5951785b23226163dd4ad3cfc5989c3784424450d50588037062f8900e654a13

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page