Easier raw SQL, with or without an ORM.
Project description
The Binder class
A Binder abstracts differences in the underlying database’s bind variable syntax and also grabs bind variables from a list of arguments, using dict, then attribute lookup.
Simple sqlite3 example:
from pynoorm.binder import Binder binder = Binder.factory("qmark") #just for test... assign a custid to binder for attribute lookup binder.custid = "AMAZON" query, parameters = binder("select * from orders where custid = %(custid)s", dict(custid="ACME"), binder)
query and parameters are now in the sqlite3/qmark format:
>>> print(query) select * from orders where custid = ? >>> print(parameters) ('ACME',)
History
0.1.0 (2016-01-17)
First release on github.
0.1.1 (2016-01-22)
Registered on PyPI
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
pynoorm-0.1.1.tar.gz
(18.6 kB
view hashes)
Close
Hashes for pynoorm-0.1.1.macosx-10.9-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f02e7fb458de4a51303f1ed976b4a7a8f4f5226eb08bbf83e5b5d42043f50e5b |
|
MD5 | b869e99cdc2307a4f8529eafea917e34 |
|
BLAKE2b-256 | 81018f8b31d62158c3b3f4cff8c181631d4e236097358b62792930981ba1b6e8 |