Skip to main content

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


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)

Uploaded Source

pynoorm-0.1.1.macosx-10.9-x86_64.tar.gz (6.0 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