Using advanced database features with Peewee, a python ORM July 01, 2012 01:30 / 0 comments

I've developed an interest in some of the more advanced features of SQLite 3.7 after reading the O'Reilly title Using SQLite (Small. Fast. Reliable. Choose Any Three). For personal projects I like using SQLite for prototyping or for simple applications, and when I need something more powerful I turn to Postgresql. Because peewee supports both of these databases (as well as MySQL), it is limited to a lowest-common-denominator feature set. While this encompasses a broad range of features, each database engine has its own extensions and I've been interested in adding some pythonic support for the cooler extensions.

Currently, I've got support for:

This post will show the usage of the hstore and full-text search extensions. I will also show how I went about writing these extension modules so if you're interested in writing your own you will have a good foundation.

All of these extensions live in the playhouse package, included with the current master branch of peewee.

To follow along at home, feel free to install peewee:

pip install -e git+https://github.com/coleifer/peewee.git#egg=peewee

peewee now supports postgresql (and mysql and sqlite) July 24, 2011 10:07 / 2 comments

Over the past month I've been working on adding support for both MySQL and PostgreSQL to peewee. I'm happy to say that after a couple weekend hack sessions all tests are now passing.