Skip to main content

A auto maping ORM for MYSQL and can bind with memcached

Project description

from sqlbean.db.sqlstore import SqlStore

#tables can in different databases

"mokodb": {
"master": "localhost:3306:mokodb:root:111111",
"tables": ["*", "user"],

SQLSTORE = SqlStore(db_config=DATABASE_CONFIG, **{})

def get_db_by_table(table_name):
return SQLSTORE.get_db_by_table(table_name)

from sqlbean.db import connection
connection.get_db_by_table = get_db_by_table

from sqlbean.shortcut import Model

# will auto mapping the table structure
# class User will mapping to user
# class UserProfile will mapping to user_profile and so on

class User(Model):

for i in User.where():

# more useage please the source code :)

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

sqlbean-0.603.tar.gz (18.6 kB view hashes)

Uploaded source

Supported by

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