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

DATABASE_CONFIG = {
"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):
pass

for i in User.where():
print i.id


# 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.601.tar.gz (17.3 kB view details)

Uploaded Source

File details

Details for the file sqlbean-0.601.tar.gz.

File metadata

  • Download URL: sqlbean-0.601.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sqlbean-0.601.tar.gz
Algorithm Hash digest
SHA256 24ff326ed387cc9f547e21f327d2b6564e3a732b27dac73d868b7f826da1e7c9
MD5 2633a94d29c0159daea309730eaca9fc
BLAKE2b-256 2a9b84831895aa850ac7a26426009c8c9d184f71655ddba99d499f1724c86c38

See more details on using hashes here.

Supported by

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