Releases: coleifer/peewee
Releases · coleifer/peewee
3.6.4
3.6.3
3.6.2
3.6.1
3.6.0
- Support for Python 3.7, including bugfixes related to new StopIteration handling inside of generators.
- Support for specifying
ROWS
orRANGE
window frame types. For more information, see the new frame type documentation. - Add APIs for user-defined window functions if using pysqlite3 and sqlite 3.25.0 or newer.
TimestampField
now uses 64-bit integer data-type for storage.- Added support to
pwiz
andplayhouse.reflection
to enable generating models from VIEWs. - Added lower-level database API for introspecting VIEWs.
- Revamped continuous integration setup for better coverage, including 3.7 and 3.8-dev.
- Allow building C extensions even if Cython is not installed, by distributing pre-generated C source files.
- Switch to using
setuptools
for packaging.
3.5.2
- New guide to using window functions in Peewee.
- New and improved table name auto-generation. This feature is not backwards compatible, so it is disabled by default. To enable, set
legacy_table_names=False
in your model'sMeta
options. For more details, see table names documentation. - Allow passing single fields/columns to window function
order_by
andpartition_by
arguments. - Support for
FILTER (WHERE...)
clauses with window functions and aggregates. - Added
IdentityField
class suitable for use with Postgres 10's new identity column type. It can be used anywhereAutoField
orBigAutoField
was being used previously. - Fixed bug creating indexes on tables that are in attached databases (SQLite).
- Fixed obscure bug when using
prefetch()
andModelAlias
to populate a back-reference related model.
3.5.1
New features
- New documentation for working with relationships in Peewee.
- Improved tests and documentation for MySQL upsert functionality.
- Allow
database
parameter to be specified withModelSelect.get()
method. For discussion, see #1620. - Add
QualifiedNames
helper to peewee module exports. - Add
temporary=
meta option to support temporary tables. - Allow a
Database
object to be passed to constructor ofDataSet
helper.
Bug fixes
- Fixed edge-case where attempting to alias a field to it's underlying column-name (when different), Peewee would not respect the alias and use the field name instead. See #1625 for details and discussion.
- Raise a
ValueError
when joining and aliasing the join to a foreign-key'sobject_id_name
descriptor. Should prevent accidentally introducing O(n) queries or silently ignoring data from a joined-instance. - Fixed bug for MySQL when creating a foreign-key to a model which used the
BigAutoField
for it's primary-key. - Fixed bugs in the implementation of user-defined aggregates and extensions with the APSW SQLite driver.
- Fixed regression introduced in 3.5.0 which ignored custom Model
__repr__()
. - Fixed regression from 2.x in which inserting from a query using a
SQL()
was no longer working. Refs #1645.
3.5.0
Backwards-incompatible changes
- Custom Model
repr
no longer use the convention of overriding__unicode__
, and now use__str__
. - Redesigned the sqlite json1 integration. and changed some of the APIs and semantics of various
JSONField
methods. The documentation has been expanded to include more examples and the API has been simplified to make it easier to work with. These changes do not have any effect on the Postgresql JSON fields.
New features
- Better default
repr
for model classes and fields. ForeignKeyField()
accepts a new initialization parameter,deferrable
, for specifying when constraints should be enforced.BitField.flag()
can be called without a value parameter for the common use-case of using flags that are powers-of-2.SqliteDatabase
pragmas can be specified as adict
(previously required a list of 2-tuples).- SQLite
TableFunction
(docs) will print Python exception tracebacks raised in theinitialize
anditerate
callbacks, making debugging significantly easier.
Bug fixes
- Fixed bug in
migrator.add_column()
where, if the field being added declared a non-standard index type (e.g., binary json field with GIN index), this index type was not being respected. - Fixed bug in
database.table_exists()
where the implementation did not match the documentation. Implementation has been updated to match the documentation. - Fixed bug in SQLite
TableFunction
implementation which raised errors if the return value of theiterate()
method was not atuple
.
3.4.0
Backwards-incompatible changes
- The
regexp()
operation is now case-sensitive for MySQL and Postgres. To perform case-insensitive regexp operations, useiregexp()
. - The SQLite
BareField()
field-type now supports all column constraints except specifying the data-type. Previously it silently ignored any column constraints. - LIMIT and OFFSET parameters are now treated as parameterized values instead of literals.
- The
schema
parameter for SQLite database introspection methods is no longer ignored by default. The schema corresponds to the name given to an attached database. ArrayField
now accepts a new parameterfield_kwargs
, which is used to pass information to the array field'sfield_class
initializer.
New features and other changes
- SQLite backup interface supports specifying page-counts and a user-defined progress handler.
- GIL is released when doing backups or during SQLite busy timeouts (when using the peewee SQLite busy-handler).
- Add NATURAL join-type to the
JOIN
helper. - Improved identifier quoting to allow specifying distinct open/close-quote characters. Enables adding support for MSSQL, for instance, which uses square brackets, e.g.
[table].[column]
. - Unify timeout interfaces for SQLite databases (use seconds everywhere rather than mixing seconds and milliseconds, which was confusing).
- Added
attach()
anddetach()
methods to SQLite database, making it possible to attach additional databases (e.g. an in-memory cache db).
3.3.4
- Added a
BinaryUUIDField
class for efficiently storing UUIDs in 16-bytes. - Fix dataset's
update_cache()
logic so that when updating a single table that was newly-added, we also ensure that all dependent tables are updated at the same time. Refs coleifer/sqlite-web#42.