pony

Pony Object Relational Mapper

APACHE-2.0 License

Downloads
1M
Stars
3.5K
Committers
25

Bot releases are visible (Hide)

pony - PonyORM release 0.7.19 (2024-08-27) Latest Release

Published by kozlovsky about 2 months ago

Bugfixes

  • Add missed Python 3.12 classifier
pony - PonyORM release 0.7.18 (2024-08-26)

Published by kozlovsky about 2 months ago

Features

  • Add Python 3.12 support

Bugfixes

  • Fix JSON handling in SQLite >= 3.45 (#704)
pony - PonyORM release 0.7.17 (2023-09-25)

Published by kozlovsky about 1 year ago

Features

  • Add Python 3.11 support; drop support for Python < 3.8

Bugfixes

  • Fix #636 nullable IntArray and StrArray
  • Fix quoting table alias in MySQL DELETE queries
  • Fix handling of default argument values in hybrid methods and functions
pony - PonyORM release 0.7.16 (2022-01-28)

Published by kozlovsky over 2 years ago

This is a bugfix-only release.

Bugfixes

  • Fixes #628: DBAPIProvider.init() got multiple values for argument 'database'
pony - PonyORM release 0.7.15 (2022-01-22)

Published by kozlovsky over 2 years ago

Hi all! We released Pony ORM 0.7.15. This release includes:

  • A long-awaited support of Python 3.10.
  • A possibility to create shared-in memory SQLite databases that can be accessed from multiple threads

Support of Python 3.10

Previous versions of PonyORM use Python parser module from Python 2.x to parse Python AST. The support of this module was dropped in Python 3.10. Because of this, Pony ORM switches to new ast module.

With this change, the support of Python 2.7 and old versions of Python 3 was dropped, and the supported versions now are Python 3.6-Python 3.10

Shared in-memory SQLite databases

Previously in-memory SQLite databases are created in Pony ORM by specifying ":memory:" string as a database filename. The database created this way cannot be used in multiple threads. Now it is possible to use ":sharedmemory:" string to create a database that can be accessed from multiple threads.

Other changes

  • Do not perform optimistic checks when deleting an object (it is OK if it was already deleted by concurrent transaction)
  • Validation of int fields should take into account field size and check that the value is fit into the range
  • More tests for hybrid methods added
  • Fix incorrect assertion check assert t is translator.
  • Fix aggregated query sum(x.field for x in previous_query)
  • #594: Use a clearly synthetic filename when compiling dynamic code to not confuse coverage.py
  • Use DecompileError exception instead of AssertionError when a function cannot be decompiled
pony - PonyORM release 0.7.15-RC1 (2022-01-10)

Published by kozlovsky almost 3 years ago

In this release, PonyORM got the support of Python 3.10. The code was rewritten significantly to use the standard Python ast module which comes with Python 3. Now PonyORM works on Python versions 3.7-3.10, and support of Python 2 was ended.

Bugfixes

  • Do not perform optimistic checks when deleting an object (it is OK if it was already deleted by concurrent transaction)
  • Validation of int fields should take into account field size and check that the value is fit into the range
  • More tests for hybrid methods added
  • Fix incorrect assertion check assert t is translator.
  • Fix aggregated query sum(x.field for x in previous_query)
  • #594: Use a clearly synthetic filename when compiling dynamic code to not confuse coverage.py
  • Use DecompileError exception instead of AssertionError when a function cannot be decompiled.
pony - PonyORM release 0.7.14 (2020-11-23)

Published by kozlovsky almost 4 years ago

Features

  • Add Python 3.9 support
  • Allow to use kwargs in select: Entity.select(**kwargs) and obj.collection.select(**kwargs), a feature that was announced but actually missed from 0.7.7
  • Add support for volatile collection attributes that don't throw "Phantom object appeared/disappeared" exceptions

Bugfixes

  • Fix negative timedelta conversions
  • Pony should reconnect to PostgreSQL when receiving 57P01 error (AdminShutdown)
  • Allow mixing compatible types (like int and float) in coalesce() arguments
  • Support of subqueries in coalesce() arguments
  • Fix using aggregated subqueries in ORDER BY section
  • Fix queries with expressions like (x, y) in ((a, b), (c, d))
  • #451: KeyError for seeds with unique attributes in SessionCache.update_simple_index()
pony - PonyORM release 0.7.13 (2020-03-03)

Published by kozlovsky over 4 years ago

This release contains no new features or bugfixes. The only reason for this release is to test our CI/CD process.

pony - PonyORM release 0.7.12 (2020-02-04)

Published by kozlovsky over 4 years ago

Features

  • CockroachDB support added
  • CI testing for SQLite, PostgreSQL & CockroachDB

Bugfixes

  • Fix translation of getting array items with negative indexes
  • Fix string getitem translation for slices and negative indexes
  • PostgreSQL DISTINCT bug fixed for queries with ORDER BY clause
  • Fix date difference syntax in PostgreSQL
  • Fix casting json to dobule in PostgreSQL
  • Fix count by several columns in PostgreSQL
  • Fix PostgreSQL MIN and MAX expressions on boolean columns
  • Fix determination of interactive mode in PyCharm
  • Fix column definition when sql_default is specified: DEFAULT should be before NOT NULL
  • Relax checks on updating in-memory cache indexes (don't throw CacheIndexError on valid cases)
  • Fix deduplication logic for attribute values
pony - PonyORM release 0.7.11 (2019-10-23)

Published by kozlovsky almost 5 years ago

Features

  • #472: Python 3.8 support
  • Support of hybrid functions (inlining simple Python functions into query)
  • #438: support datetime-datetime, datetime-timedelta, datetime+timedelta in queries

Bugfixes

  • #430: add ON DELETE CASCADE for many-to-many relationships
  • #465: Should reconnect to MySQL on OperationalError 2013 'Lost connection to MySQL server during query'
  • #468: Tuple-value comparisons generate incorrect queries
  • #470 fix PendingDeprecationWarning of imp module
  • Fix incorrect unpickling of objects with Json attributes
  • Check value of discriminator column on object creation if set explicitly
  • Correctly handle Flask current_user proxy when adding new items to collections
  • Some bugs in syntax of aggregated queries were fixed
  • Fix syntax of bulk delete queries
  • Bulk delete queries should clear query results cache so next select will get correct result from the database
  • Fix error message when hybrid method is too complex to decompile
pony - PonyORM release 0.7.10 (2019-04-20)

Published by kozlovsky over 5 years ago

Bugfixes

  • Python3.7 and PyPy decompiling fixes
  • Fix reading NULL from Optional nullable array column
  • Fix handling of empty arrays in queries
  • #415: error message typo
  • #432: PonyFlask - request object can trigger teardown_request without real request
  • Fix GROUP CONCAT separator for MySQL
pony - PonyORM bugfix release 0.7.9 (2019-01-21)

Published by kozlovsky over 5 years ago

Bugfixes

  • Fix handling of empty arrays and empty lists in queries
  • Fix reading optional nullable array columns from database
pony - PonyORM release 0.7.8 (2019-01-19)

Published by kozlovsky over 5 years ago

This is a bug fix release

Bugfixes

  • #414: prefetching Optional relationships fails on 0.7.7
  • Fix a bug caused by incorrect deduplication of column values
pony - PonyORM release 0.7.7 (2019-01-17)

Published by kozlovsky almost 6 years ago

Major features

  • Array type support for PostgreSQL and SQLite
  • isinstance() support in queries
  • Support of queries based on collections: select(x for x in y.items)

Other features

  • Support of Entity.select(**kwargs)
  • Support of SKIP LOCKED option in 'SELECT ... FOR UPDATE'
  • New function make_proxy(obj) to make cros-db_session proxy objects
  • Specify ON DELETE CASCADE/SET NULL in foreign keys
  • Support of LIMIT in SELECT FROM (SELECT ...) type of queries
  • Support for negative JSON array indexes in SQLite

Improvements

  • Improved query prefetching: use fewer number of SQL queries
  • Memory optimization: deduplication of values recieved from the database in the same session
  • increase DBAPIProvider.max_params_count value

Bugfixes

  • #405: breaking change with cx_Oracle 7.0: DML RETURNING now returns a list
  • #380: db_session should work with async functions
  • #385: test fails with python3.6
  • #386: release unlocked lock error in SQLite
  • #390: TypeError: writable buffers are not hashable
  • #398: add auto coversion of numpy numeric types
  • #404: GAE local run detection
  • Fix Flask compatibility: add support of LocalProxy object
  • db_session(sql_debug=True) should log SQL commands also during db_session.exit()
  • Fix duplicated table join in FROM clause
  • Fix accessing global variables from hybrid methods and properties
  • Fix m2m collection loading bug
  • Fix composite index bug: stackoverflow.com/questions/53147694
  • Fix MyEntity[obj.get_pk()] if pk is composite
  • MySQL group_concat_max_len option set to max of 32bit platforms to avoid truncation
  • Show all attribute options in show(Entity) call
  • For nested db_session retry option should be ignored
  • Fix py_json_unwrap
  • Other minor fixes
pony - Pony ORM Release 0.7.6 (2018-08-10)

Published by kozlovsky about 6 years ago

Features since 0.7.5:

  • f-strings support in queries: select(f'{s.name} - {s.age}' for s in Student)
  • #344: It is now possible to specify offset without limit: query.limit(offset=10)
  • #371: Support of explicit casting of JSON expressions to str, int or float
  • @db.on_connect decorator added

Bugfixes

  • Fix bulk delete bug introduced in 0.7.4
  • #370 Fix memory leak introduced in 0.7.4
  • Now exists() in query does not throw away condition in generator expression:
    exists(s.gpa > 3 for s in Student)
  • #373: 0.7.4/0.7.5 breaks queries using the in operator to test membership of another query result
  • #374: auto=True can be used with all PrimaryKey types, not only int
  • #369: Make QueryResult looks like a list object again: add concatenation with lists, .shuffle() and .to_list() methods
  • #355: Fix binary primary keys PrimaryKey(buffer) in Python2
  • Interactive mode support for PyCharm console
  • Fix wrong table aliases in complex queries
  • Fix query optimization code for complex queries
  • Fix a bug with hybrid properties that use external functions
pony - Pony ORM 0.7.6 Release Candidate 1

Published by kozlovsky about 6 years ago

This is mostly bugfix release to fix bugs introduced in 0.7.4

New features

  • f-strings support in queries: select(f'{s.name} - {s.age}' for s in Student)
  • #344: It is now possible to specify offset without limit: query.limit(offset=10)
  • #371: Support of explicit casting of JSON expressions to str, int or float
  • #367: @db.on_connect decorator added

Bugfixes

  • Fix bulk delete bug introduced in 0.7.4
  • #370 Fix memory leak introduced in 0.7.4
  • Now exists() in query does not throw away condition in generator expression: exists(s.gpa > 3 for s in Student)
  • #373: 0.7.4/0.7.5 breaks queries using the in operator to test membership of another query result
  • #374: auto=True can be used with all PrimaryKey types, not only int
  • #369: Make QueryResult looks like a list object again: add concatenation with lists, .shuffle() and .to_list() methods
  • #355: Fix binary primary keys PrimaryKey(buffer) in Python2
  • Interactive mode support for PyCharm console
  • Fix wrong table aliases in complex queries
  • Fix query optimization code for complex queries
pony - Pony ORM Release 0.7.5 (2018-07-24)

Published by kozlovsky about 6 years ago

Bugfixes

  • query.where and query.filter method bug introduced in 0.7.4 was fixed
pony - Pony ORM Release 0.7.4

Published by kozlovsky about 6 years ago

Major features

Other features

  • distinct option added to aggregate functions
  • Support of explicit casting to float and bool in queries

Improvements

  • Apply @cut_traceback decorator only when pony.MODE is 'INTERACTIVE'

Bugfixes

  • In SQLite3 LIKE is case sensitive now
  • #249: Fix incorrect mixin used for Timedelta
  • #251: correct dealing with qualified table names
  • #301: Fix aggregation over JSON Column
  • #306: Support of frozenset constants added
  • #308: Fixed an error when assigning JSON attribute value to the same attribute: obj.json_attr = obj.json_attr
  • #313: Fix missed retry on exception raised during db_session.__exit__
  • #314: Fix AttributeError: 'NoneType' object has no attribute 'seeds'
  • #315: Fix attribute lifting for JSON attributes
  • #321: Fix KeyError on obj.delete()
  • #325: duplicating percentage sign in raw SQL queries without parameters
  • #331: Overriding __len__ in entity fails
  • #336: entity declaration serialization
  • #357: reconnect after PostgreSQL server closed the connection unexpectedly
  • Fix Python implementation of between() function and rename arguments: between(a, x, y) ->
    between(x, a, b)
  • Fix retry handling: in PostgreSQL and Oracle an error can be raised during commit
  • Fix optimistic update checks for composite foreign keys
  • Don't raise OptimisticCheckError if db_session is not optimistic
  • Handling incorrect datetime values in MySQL
  • Improved ImportError exception messages when MySQLdb, pymysql, psycopg2 or psycopg2cffi driver was not found
  • desc() function fixed to allow reverse its effect by calling desc(desc(x))
  • __contains__ method should check if objects belong to the same db_session
  • Fix pony.MODE detection; mod_wsgi detection according to official doc
  • A lot of inner fixes
pony - Pony ORM Release 0.7.3 (2017-10-23)

Published by kozlovsky almost 7 years ago

New features

  • where() method added to query
  • coalesce() function added
  • between(x, a, b) function added
  • #295: Add _table_options_ for entity class to specify engine, tablespace, etc.
  • Make debug flag thread-local
  • sql_debugging context manager added
  • sql_debug and show_values arguments to db_session added
  • set_sql_debug function added as alias to (to be deprecated) sql_debug function
  • Allow db_session to accept ddl parameter when used as context manager
  • Add optimistic=True option to db_session
  • Skip optimistic checks for queries in db_session with serializable=True
  • fk_name option added for attributes in order to specify foreign key name
  • #280: Now it's possible to specify timeout option, as well as pass other keyword arguments for sqlite3.connect function
  • Add support of explicit casting to int in queries using int() function
  • Added modulo division % native support in queries

Bugfixes

  • Fix bugs with composite table names
  • Fix invalid foreign key & index names for tables which names include schema name
  • For queries like select(x for x in MyObject if not x.description) add "OR x.info IS NULL" for nullable string columns
  • Add optimistic checking for delete() method
  • Show updated attributes when OptimisticCheckError is being raised
  • Fix incorrect aliases in nested queries
  • Correctly pass exception from user-defined functions in SQLite
  • More clear error messages for UnrepeatableReadError
  • Fix db_session(strict=True) which was broken in 2d3afb24
  • Fixes #170: Problem with a primary key column used as a part of another key
  • Fixes #223: incorrect result of getattr(entity, attrname) when the same lambda applies to different entities
  • Fixes #266: Add handler to "pony.orm" logger does not work
  • Fixes #278: Cascade delete error: FOREIGN KEY constraint failed, with complex entity relationships
  • Fixes #283: Lost Json update immediately after object creation
  • Fixes #284: query.order_by() orders Json numbers like strings
  • Fixes #288: Expression text parsing issue in Python 3
  • Fixes #293: translation of if-expressions in expression
  • Fixes #294: Real stack traces swallowed within IPython shell
  • Collection.count() method should check if session is alive
  • Set obj._session_cache_ to None after exiting from db session for better garbage collection
  • Unload collections which are not fully loaded after exiting from db session for better garbage collection
  • Raise on unknown options for attributes that are part of relationship
pony - Pony ORM Release 0.7.2 (2017-07-17)

Published by kozlovsky over 7 years ago

New features

Bugfixes

  • Fixes #219: when a database driver raises an error, sometimes this error was masked by the 'RollbackException: InterfaceError: connection already closed' exception. This happened because on error, Pony tried to rollback transaction, but the connection to the database was already closed and it masked the initial error. Now Pony displays the original error which helps to understand the cause of the problem.
  • Fixes #276: Memory leak
  • Fixes the all declaration. Previously IDEs, such as PyCharm, could not understand what is going to be imported by 'from pony.orm import *'. Now it works fine.
  • Fixes #232: negate check for numeric expressions now checks if value is zero or NULL
  • Fixes #238, fixes #133: raise TransactionIntegrityError exception instead of AssertionError if obj.collection.create(**kwargs) creates a duplicate object
  • Fixes #221: issue with unicode json path keys
  • Fixes bug when discriminator column is used as a part of a primary key
  • Handle situation when SQLite blob column contains non-binary value