Skip to main content

A wrapper around psycopg2 to make common things easier.

Project description

Here are a few of the features:

Query results can be accessed as a dictionary of columns.

Queries return indexable iterators with dictionary syntax, so you can do things like “for row in query”, and “query(cmd)[0]”. Note that indexes can only be larger than or equal to the last index.

Query arguments are passed as discrete arguments, not as a tuple. Passing as a tuple always makes me want to do a “%” and if I accidentally do that it can open up a SQL injection.

There’s an “insert” helper that takes a table name and keyword arguments. Similarly there’s a “dictinsert” helper that takes a dictionary of row:values.

Project details


Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page