- New transaction model (link)
- New method
Query.filter()
allows step-by-step query construction (link) - New method
Database.bind()
simplifies testing and allows using different settings for development and production (link) - New method
Query.page()
simplifies pagination (link) - New method
MyEntity.select_random(N)
is effective for large tables (link) - New method
Query.random(N)
for selecting random instances (link) - Support of new
concat()
function inside declarative queries - New
before_insert()
,before_update()
,before_delete()
entity instance hooks which can be overridden - Ability to specify
sequence_name='seq_name'
for PrimaryKey attributes for Oracle database - Ability to create new entity instances specifying the value of the primary key instead of the object
- Ability to read entity object attributes outside of the db_session
- Ability to use lambdas as a reference to an entity in relationship attribute declarations (link)
- The names of tables, indexes and constraints in the database creation script now are sorted in the alphabetical order
- In MySQL and PostgreSQL Pony converts the table names to the lower case. In Oracle – to the upper case. In SQLite leaves as is.
- The option
options.MAX_FETCH_COUNT
is set toNone
by default now - The support of PyGreSQL is discontinued, using psycopg2 instead
- Added
pony.__version__
attribute - Multiple bugs were fixed
- Stability and performance improvements
- Database
create_tables()
/drop_all_tables()
methods Database.drop_table(name)
,Entity.drop_table()
,Set.drop_table()
methodsDatabase.disconnect()
methods (allows SQLite files deletion after disconnection)- Pony now automatically enables foreign key checks in SQLite
Entity.exists(...)
method addeddistinct()
function added:select((s.group, sum(distinct(s.gpa))) for s in Student)
- Refactoring & bugfixes
- Use standard transaction mode by default instead of optimistic mode
SELECT ... FOR UPDATE
support added:select(...).for_update()[:]
UUID
datatype support added- Automatic foreign key indexes generation
- MySQL foreign key bug workaround added
- Check_tables parameter of
generate_mapping()
is deprecated - Bug fixes
@db_session
decorator is required for any database interaction;- support of pickling/unpickling (queries and objects can be stored in memcached);
- lazy collections - don't load all the items if only one is needed;
- datetime precision now can be specified;
- multiple bugs were fixed.