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.
I've updated the documentation to include a little blurb on how you might use peewee with PostgreSQL:
psql_db = peewee.PostgresqlDatabase('my_database', user='postgres')
class PostgresqlModel(peewee.Model):
"""A base model that will use our MySQL database"""
class Meta:
database = psql_db
class Blog(PostgresqlModel):
author = peewee.CharField()
# etc, etc
# when you're ready to start querying, remember to connect
psql_db.connect()
If you're interested in getting the gist of how peewee works, check out the "common uses" documentation. There's also an example app which is running here.
Peewee can do a lot, but it is not a replacement for SQL - it also does not try to offer the power or expressiveness of some other ORMs, notably SQLAlchemy. That being said, if you want something:
then this might be the project you're looking for.
Reading your code was really inspiring when I was working on https://github.com/dmr/Ldtools and other projects. Although this might sound like the spam comments I get all the time, keep up the good work! Are there any projects using peewee you know about?
Thanks for the encouragement, Daniel, and I'm glad you found the project helpful! While I have not seen any wild peewee examples, I have used it myself on a number of projects...being familiar with django I find it really easy to use peewee and "get what I want" using flask. I've also used it for some non-web-app stuff as well with good results.
Commenting has been closed, but please feel free to contact me