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

Install

pip install mydb

Usage

Single Connection

from mydb.connection import Connection

db = Connection("mysql://youngking@localhost:13306/mydatabase")
for article in db.query("SELECT * FROM articles"):
    print article.title

Multiple Connection Like Master/Slave

from mydb.router import ConnectionRouter
from mydb.proxy import DBProxy
router = ConnectionRouter(["myapp.somewhere.MasterSlaveRouter"])
db = DBProxy(router)

for article in db.query("SELECT * FROM articles"):
    print article.title

Database routers

A database Router is a class that provides up to two methods:

db_for_read(statement, **hints)

Suggest the database that should be used for read operations for ``SELECT`` statement.

If a database operation is able to provide any additional information that might assist in selecting a database, it will be provided in the hints dictionary. Details on valid hints are provided below.

Returns None if there is no suggestion.

db_for_write(model, **hints)

Suggest the database that should be used for writes of statements except ``SELECT``.

If a database operation is able to provide any additional information that might assist in selecting a database, it will be provided in the hints dictionary. Details on valid hints are provided below.

There is an example in tests/test_router.py.

A router doesn’t have to provide all these methods – it may omit one or more of them. If one of the methods is omitted, mydb will skip that router when performing the relevant check.

In mydb.router there are some default routers, where you can inherit from and overwriten them.

Release History

Release History

0.1.2

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.1.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
mydb-0.1.2.tar.gz (17.6 kB) Copy SHA256 Checksum SHA256 Source Oct 29, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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