You can just use Psycopg2 in Tornado. There's no need for special
support, but it will not be asynchronous.
If you want to use an asynchronous PostgreSQL driver, here:
http://momoko.61924.nl/
Also check the list of other libraries for Tornado:
https://github.com/facebook/tornado/wiki/Links
On Mon, Jun 11, 2012 at 5:23 AM, SvartalF <
se...@svartalf.info> wrote:
> For me lack of support of PostgreSQL database in a tornado is a bad thing.
>
> I had found this pull request
> (
https://github.com/facebook/tornado/pull/419), which was unaccepted due a
> API design problems, and thought that it's a good idea - make support for
> different databases in the tornado.
>
> Current implementation has support for two databases: for MySQL and
> PostgreSQL:
>
https://github.com/svartalf/tornado/tree/db-refactoring/tornado/database
>
> For a easy usage there is a function `tornado.database.connect` which is
> accepts all the arguments like an old-n-good `tornado.database.Connection`,
> except one thing: first parameter is a database type string. It looks like
> this:
>
>
> from tornado import database
>
> mysql = database.connect('mysql', 'localhost', 'test_db', user='root')
> postgresql = database.connect('postgresql_psycopg2', 'localhost', 'pg_db',
> user='tirion')
>
>
> Both `mysql` and `postgresql` variables are now a Connection class
> instances, like in a current tornado implementation.
>
> At now it is still in development, has no tests and documentation, but I
> wanted to discuss about a code style and an API design, so I can know that
> development is moving into a right direction. What do you think about all of
> this?