Skip to main content

Python OR mapping tools

Project description

PyODBC DbAccess

There are 3 tools in the library:

  • OR mapping: assume object property name matches database columns
    • row to object: pypigeonhole_dbaccess.obj_mapper.row_to_obj()
    • rows to list of object: pypigeonhole_dbaccess.obj_mapper.query_list()
    • generate sql statements for insert
    • generate select statement based on an object. This is not natural.
    • may have to handle _name and __name cases because of property.
  • Local transaction manager: pypigeonhole_dbaccess.tx_manager
    It handles nested transactions, i.e., if any part of database operations fails, all operations rollback.
  • Bulk SQL uploader: To insert one row into a database, we use
    insert into <table> (?, ?, ..., ?) values (...)
    To insert many rows,
    insert into <table> (?, ?, ..., ?) values (...), (...), ..., (...)
    and then batch them. Python twists the insert statements with executemany().

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

pypigeonhole-dbaccess-0.0.1.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

pypigeonhole_dbaccess-0.0.1-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

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