Tracking changes in peewee between versions. For a complete view of all the releases, visit GitHub:
https://github.com/coleifer/peewee/releases
This release contains a number of bugfixes, enhancements and a rewrite of much of the documentation.
- New and improved documentation
- Added aggregate_rows() method for mitigating N+1 queries.
- Query compiler performance improvements and rewrite of table alias internals (51d82fcd and d8d55df04).
- Added context-managers and decorators for counting queries and asserting query counts.
- Allow
UPDATE
queries to contain subqueries for values (example). - Support for
INSERT INTO / SELECT FROM
queries (docs). - Allow
SqliteDatabase
to set the database's journal mode. - Added method for concatenation (docs).
- Moved
UUIDField
out of the playhouse and into peewee - Added pskel script.
- Documentation for BerkeleyDB.
- #340, allow inner query values to be used in outer query joins.
- #380, fixed foreign key handling in SQLite migrations.
- #389, mark foreign keys as dirty on assignment.
- #391, added an
orwhere()
method. - #392, fixed
order_by
meta option inheritance bug. - #394, fixed UUID and conversion of foreign key values (thanks @alexlatchford).
- #395, allow selecting all columns using
SQL('*')
. - #396, fixed query compiler bug that was adding unnecessary parentheses around expressions.
- #405, fixed behavior of
count()
when query has a limit or offset.
This is a small release and contains a handful of fixes.
- Added a
Window
object for creating reusable window definitions. - Added support for
DISTINCT ON (...)
. - Added a BerkeleyDB-backed sqlite
Database
and build script. - Fixed how the
UUIDField
handlesNone
values (thanks @alexlatchford). - Fixed various things in the example app.
- Added 3.4 to the travis build (thanks @frewsxcv).
This release contains a complete rewrite of pwiz
as well as some improvements to the SQLite extension, including support for the BM25 ranking algorithm for full-text searches. I also merged support for sqlcipher, an encrypted SQLite database with many thanks to @thedod!
- Rewrite of
pwiz
, schema introspection utility. Model.save()
returns a value indicating the number of modified rows.- Fixed bug with
PostgresqlDatabase.last_insert_id()
leaving a transaction open in autocommit mode (#353). - Added BM25 ranking algorithm for full-text searches with SQLite.
This release contains a new migrations module in addition to a number of small features and bug fixes.
- New migrations module.
- Added a return value to
Model.save()
indicating number of rows affected. - Added a
date_trunc()
method that works for Sqlite. - Added a
Model.sqlall()
class-method to return all the SQL to generate the model / indices.
- #342, allow functions to not coerce parameters automatically.
- #338, fixed unaliased columns when using Array and Json fields with postgres, thanks @mtwesley.
- #331, corrected issue with the way unicode arrays were adapted with psycopg2.
- #328, pwiz / mysql bug.
- #326, fixed calculation of the alias_map when using subqueries.
- #324, bug with
prefetch()
not selecting the correct primary key.
I've been looking forward to this release, as it contains a couple new features that I've been wanting to add for some time now. Hope you find them useful.
- Window queries using
OVER
syntax. - Compound query operations
UNION
,INTERSECT
,EXCEPT
as well as symmetric difference.
- #300, pwiz was not correctly interpreting some foreign key constraints in SQLite.
- #298, drop table with cascade API was missing.
- #294, typo.
This release contains a large refactoring of the way SQL was generated for both
the standard query classes (Select
, Insert
, Update
, Delete
) as well as
for the DDL methods (create_table
, create_index
, etc). Instead of joining
strings of SQL and manually quoting things, I've created Clause
objects
containing multiple Node
objects to represent all parts of the query.
I also changed the way peewee determins the SQL to represent a field. Now a
field implements __ddl__
and __ddl_column__
methods. The former creates
the entire field definition, e.g.:
"quoted_column_name" <result of call to __ddl_column__> [NOT NULL/PRIMARY KEY/DEFAULT NEXTVAL(...)/CONSTRAINTS...]
The latter method is responsible just for the column type definition. This might
return VARCHAR(255)
or simply TEXT
. I've also added support for
arbitrary constraints on each field, so you might have:
price = DecimalField(decimal_places=2, constraints=[Check('price > 0')])
- Refactored query generation for both SQL queries and DDL queries.
- Support for arbitrary column constraints.
autorollback
option to theDatabase
class that will roll back the transaction before raising an exception.- Added
JSONField
type to thepostgresql_ext
module. - Track fields that are explicitly set, allowing faster saves (thanks @soasme).
- Allow the
FROM
clause to be an arbitraryNode
object (#290). schema
is a newModel.Mketa
option and is used throughout the code.- Allow indexing operation on HStore fields (thanks @zdxerr, #293).
- #277 (where calls not chainable with update query)
- #278, use
wraps()
, thanks @lucasmarshall - #284, call
prepared()
aftercreate()
, thanks @soasme. - #286, cursor description issue with pwiz + postgres
- Support for savepoints (Sqlite, Postgresql and MySQL) using an API similar to that of transactions.
- Common set of exceptions to wrap DB-API 2 driver-specific exception classes, e.g.
peewee.IntegrityError
. - When pwiz cannot determine the underlying column type, display it in a comment in the generated code.
- Support for circular foreign-keys.
- Moved
Proxy
into peewee (previously inplayhouse.proxy
). - Renamed
R()
toSQL()
. - General code cleanup, some new comments and docstrings.
- Fixed a small bug in the way errors were handled in transaction context manager.
- #257
- #265, nest multiple calls to functions decorated with
@database.commit_on_success
. - #266
- #267
Commits: https://github.com/coleifer/peewee/compare/2.1.6...2.1.7 Released 2013-12-25
Changes included in 2.1.6:
- Lightweight Django integration.
- Added a csv loader to playhouse.
- Register unicode converters per-connection instead of globally when using
pscyopg2
. - Fix for how the related object cache is invalidated (#243).
Commits: https://github.com/coleifer/peewee/compare/2.1.5...2.1.6 Released 2013-11-19
- Rewrote the
playhouse.postgres_ext.ServerSideCursor
helper to work with a single query. Docs. - Added error handler hook to the database class, allowing your code to choose how to handle errors executing SQL. Docs.
- Allow arbitrary attributes to be stored in
Model.Meta
a5e13bb26d6196dbd24ff228f99ff63d9c046f79. - Support for composite primary keys (!!). How-to and API docs.
- Added helper for generating
CASE
expressions. Docs. - Allow the table alias to be specified as a model
Meta
option. - Added ability to specify
NOWAIT
when issuingSELECT FOR UPDATE
queries.
- #147, SQLite auto-increment behavior.
- #222
- #223, missing call to
execute()
in docs. - #224, python 3 compatibility fix.
- #227, was using wrong column type for boolean with MySQL.
Commits: https://github.com/coleifer/peewee/compare/2.1.4...2.1.5 Released 2013-10-19
- Small refactor of some components used to represent expressions (mostly better names).
- Support for Array fields in postgresql.
- Added notes on Proxy
- Support for Server side cursors with postgresql.
- Code cleanups for more consistency.
Commits: https://github.com/coleifer/peewee/compare/2.1.3...2.1.4 Released 2013-08-05
- Added the
sqlite_ext
module, including support for virtual tables, full-text search, user-defined functions, collations and aggregates, as well as more granular locking. - Manually convert data-types when doing simple aggregations - fixes issue #208
- Profiled code and dramatically increased performance of benchmarks.
- Added a proxy object for lazy database initialization - fixes issue #210
Commits: https://github.com/coleifer/peewee/compare/2.1.2...2.1.3 Released 2013-06-28
Major rewrite, see notes here: http://docs.peewee-orm.com/en/latest/peewee/upgrading.html#upgrading