Skip to main content

Wrapper for twisted.enterprise.adbapi.ConnectionPool to use with tornado

Project description

Want to use twisted’s adbapi in tornado but does not know how? Try toradbapi.

This is just wrapper for twisted.enterprise.adbapi.ConnectionPool to use with tornado. So documentation for __init__ args you can find at twisted docs

Available methods in toradbapi.ConnectionPool:

  • run_query

  • run_operation

  • run_interaction

They all have similar interface as twisted’s corresponding methods. They return instance of Future, so can be yielded inside coroutine.

Example usage:

from tornado import gen
from toradbapi import ConnectionPool

pool = ConnectionPool('MySQLdb', db='test')

@gen.coroutine
def get_entities():
    entities = yield pool.run_query('SELECT * FROM `entity`')
    raise gen.Return(entities)

Demo project is under demo.py file. Also there are more examples in tests.py.

Only Python 2.7 supported for now.

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

toradbapi-0.1.3.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file toradbapi-0.1.3.tar.gz.

File metadata

  • Download URL: toradbapi-0.1.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for toradbapi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 70df5c284a871e9e4bb1bcbc48128f796033dc89e086b1da02d1d848fe5a40ca
MD5 5ad8c68e27c3bab0272e54847ecfd6ef
BLAKE2b-256 c90bd1f45b2c20847483531e86dc5383104586dd268f4ab8e4601c408ed5f749

See more details on using hashes here.

Supported by

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