Skip to content

A module for asynchronous PostgreSQL queries, works with Tornado and psycopg2.

Notifications You must be signed in to change notification settings

0x55aa/Postgresql-async-tornado

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Postgresql-async-tornado

A module for asynchronous PostgreSQL queries,works with Tornado and psycopg2.

对psycopg2的简单封装

Usage

import ptdb as db

...

class MainHandler(tornado.web.RequestHandler):
    @tornado.gen.coroutine
    def get(self):
        mid = self.get_argument("m", '')
        r = yield db.query(
            """SELECT * FROM foo WHERE id > %s
            """, (mid, ))

        context = dict(r=r)
        self.render("result.html", **context)

...

Thanks

torndb

momoko

About

A module for asynchronous PostgreSQL queries, works with Tornado and psycopg2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages