This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Handler mixins that automatically connect a PostgreSQL client session upon initialization.

Installation

sprockets.mixins.postgresql is available on the Python Package Index and can be installed via pip or easy_install:

pip install sprockets.mixins.postgresql

Example

The following example demonstrates using the HandlerMixin with a synchronous Tornado RequestHandler <tornado.web.RequestHandler> for a database named postgres:

import os

from sprockets.mixins import postgresql
from tornado import web

os.environ['POSTGRES_HOST'] = 'localhost'
os.environ['POSTGRES_USER'] = 'postgres'
os.environ['POSTGRES_PORT'] = 5432
os.environ['POSTGRES_DBNAME'] = 'postgres'

class PostgresRequestHandler(postgresql.HandlerMixin,
                             web.RequestHandler):

    DBNAME = 'postgres'

    def get(self, *args, **kwargs):
        result = self.foo_session.query('SELECT * FROM bar')
        self.finish({'data': result.items()})

The second example demonstrates using the AsyncHandlerMixin with an asynchronous Tornado RequestHandler for a database named foo:

import os

from sprockets.mixins import postgresql
from tornado import web

os.environ['FOO_HOST'] = 'localhost'
os.environ['FOO_USER'] = 'postgres'
os.environ['FOO_PORT'] = 5432
os.environ['FOO_DBNAME'] = 'foo'
os.environ['FOO_PASSWORD'] = 'bar'

class FooRequestHandler(postgresql.AsyncHandlerMixin,
                        web.RequestHandler):

    DBNAME = 'foo'

    @web.asynchronous
    def get(self, *args, **kwargs):
        result = yield self.foo_session.query('SELECT * FROM baz')
        self.finish({'data': result.items()})
        result.free()
Release History

Release History

1.0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
sprockets.mixins.postgresql-1.0.1.tar.gz (8.6 kB) Copy SHA256 Checksum SHA256 Source May 14, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting