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 details)
File details
Details for the file pynoorm-0.1.1.tar.gz.
File metadata
- Download URL: pynoorm-0.1.1.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
918b1cd1605a9d162e85f6df4a8ca3e765eb6f8bffe53133f5f89b137bf52574
|
|
| MD5 |
cfdfb3287e53b0460e8b1c65fbcfc320
|
|
| BLAKE2b-256 |
a7d9847cdeb6bfe2bdab983c41858450efd8ce1038d39e9bc37e479ab52be09c
|
File details
Details for the file pynoorm-0.1.1.macosx-10.9-x86_64.tar.gz.
File metadata
- Download URL: pynoorm-0.1.1.macosx-10.9-x86_64.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f02e7fb458de4a51303f1ed976b4a7a8f4f5226eb08bbf83e5b5d42043f50e5b
|
|
| MD5 |
b869e99cdc2307a4f8529eafea917e34
|
|
| BLAKE2b-256 |
81018f8b31d62158c3b3f4cff8c181631d4e236097358b62792930981ba1b6e8
|