Giter Site home page Giter Site logo

pianoman19372 / sprockets-postgres Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sprockets/sprockets-postgres

0.0 0.0 0.0 148 KB

An asynchronous Postgres client mixin for Tornado applications

Home Page: https://sprockets-postgres.readthedocs.io/

License: BSD 3-Clause "New" or "Revised" License

Shell 2.58% Python 97.42%

sprockets-postgres's Introduction

Sprockets Postgres

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

Configuration of sprockets-postgres is done by using of environment variables or tornado.web.Application.settings dictionary. The sprockets_postgres.ApplicationMixin will use configuration as applied to the settings dictionary, falling back to the environment variable if the value is not set in the dictionary. Keys in the settings dictionary are lowercase, and if provided as environment variables, are uppercase.

The following table details the available configuration options:

Variable Definition Type Default
postgres_url The PostgreSQL URL to connect to str ย 
postgres_max_pool_size Maximum connection count to Postgres per backend int 10
postgres_min_pool_size Minimum or starting pool size. int 1
postgres_connection_timeout The maximum time in seconds to spend attempting to create a new connection. int 10
postgres_connection_ttl Time-to-life in seconds for a pooled connection. int 300
postgres_query_timeout Maximum execution time for a query in seconds. int 60
postgres_hstore Enable HSTORE support in the client. bool FALSE
postgres_json Enable JSON support in the client. bool FALSE
postgres_uuid Enable UUID support in the client. bool 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 and the URL will be constructed containing all host and port combinations in priority and weighted order, utilizing libpq's supoprt for multiple hosts in a URL.

Requirements

Version History

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.