Skip to main content

Pyramid sqlalchemy extension

Project description

A simple pyramid extension which register a sqlalchemy utility. It add a sqla_session property to request object. Session is opened at first access and automatically commited and closed on request’s finished callback.

It tights sqlalchemy session to request lifecycle rather than relying on thread local scoped sessions as recommended in sqlalchemy documentation:

“The Session can be established as the request begins, or using a lazy initialization pattern which establishes one as soon as it is needed. The request then proceeds, with some system in place where application logic can access the current Session in a manner associated with how the actual request object is accessed. As the request ends, the Session is torn down as well, usually through the usage of event hooks provided by the web framework.”

http://docs.sqlalchemy.org/en/rel_0_8/orm/session.html

Source code available on https://github.com/hadrien/pyramid_sqlalchemy_utility

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

pyramid_sqlalchemy_utility-0.0.1.tar.gz (2.3 kB view details)

Uploaded Source

File details

Details for the file pyramid_sqlalchemy_utility-0.0.1.tar.gz.

File metadata

File hashes

Hashes for pyramid_sqlalchemy_utility-0.0.1.tar.gz
Algorithm Hash digest
SHA256 53bde1ba80d6f2d5eae57a4ce5444d8f3bcfb8755faa3ab403e1bbf345c999ea
MD5 686ee11aa6fb7a9453a578c4e27161ae
BLAKE2b-256 f759450fd9923d2724fa05a2f4695865c481437d852740a466b788fa7c5d5467

See more details on using hashes here.

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