summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Replace c extension with cython versions.workflow_test_cythonFederico Caselli2021-12-1743-2999/+2993
| | | | | | | | | | | | | | | Re-implement c version immutabledict / processors / resultproxy / utils with cython. Performance is in general in par or better than the c version Added a collection module that has cython version of OrderedSet and IdentitySet Added a new test/perf file to compare the implementations. Run ``python test/perf/compiled_extensions.py all`` to execute the comparison test. See results here: https://docs.google.com/document/d/1nOcDGojHRtXEkuy4vNXcW_XOJd9gqKhSeALGG3kYr6A/edit?usp=sharing Fixes: #7256 Change-Id: I2930ef1894b5048210384728118e586e813f6a76 Signed-off-by: Federico Caselli <cfederico87@gmail.com>
* Merge "include InterfaceError for mariadb disconnect check" into mainmike bayer2021-12-162-9/+25
|\
| * include InterfaceError for mariadb disconnect checkMike Bayer2021-12-162-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Corrected the error classes inspected for the "is_disconnect" check for the ``mariadbconnector`` dialect, which was failing for disconnects that occurred due to common MySQL/MariaDB error codes such as 2006; the DBAPI appears to currently use the ``mariadb.InterfaceError`` exception class for disconnect errors such as error code 2006, which has been added to the list of classes checked. For the current "real reconnect test", shutting down the mariadb connection from the client side produces ProgrammingError("Connection isn't valid anymore") which we also continue to intercept. Fixes: #7457 Change-Id: I0b37cd7a73359a23ad756ff2af0a9333c841221b
* | restore psycopg changelog fileMike Bayer2021-12-151-0/+16
| | | | | | | | | | | | | | | | this file was removed from 1.4 as part of 3b6a68b. as this is a 2.0 only change, restore it there. Change-Id: Idd7081d9e09b4b725283b4a7965ee37fd169eac8 References: #6842
* | bump psycopg to 3.0.7Mike Bayer2021-12-142-2/+1
|/ | | | | | | | revert the change from 893b4e03921eb1a86e202988bf247251d0d2fae9 and set lower bound for psycopg to 3.0.7 Change-Id: If506c6c3190c4d40683a10ddaea32a417e9c6ed4 References: https://github.com/psycopg/psycopg/issues/178
* Ignore ephemeral classes in test_all_present()Nils Philippsen2021-12-142-1/+14
| | | | | | | | | | | | | | | | | | Fixed a regression in the test suite where the test called ``CompareAndCopyTest::test_all_present`` would fail on some platforms due to additional testing artifacts being detected. Pull request courtesy Nils Philippsen. In some circumstances, ephemeral class objects that are created within the scope of a test method don't seem to be garbage collected directly on exit. Filter out classes created in test modules. Fixes: #7450 Closes: #7451 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7451 Pull-request-sha: 135a8aaba2c6941460c7f45aa1a55c8f6b9eb43d Change-Id: I621967bd916089dc1e3f98625fd2a852cd9fd712
* skip rowcount test for psycopgMike Bayer2021-12-141-0/+1
| | | | | | | | | | psycopg is failing to report correct rowcount for this test against PostgreSQL 14 only as of psycopg 3.0.5 or 3.0.6; works in 3.0.4 skip test until a report can be filed w/ psycopg Change-Id: I6a0b8c26314a9e451a1c93c3e48665c650115982
* Merge "implement correct errors for Row immutability" into mainmike bayer2021-12-123-13/+106
|\
| * implement correct errors for Row immutabilityMike Bayer2021-12-093-13/+106
| | | | | | | | | | | | | | | | | | | | Corrected the error message for the ``AttributeError`` that's raised when attempting to write to an attribute on the :class:`_result.Row` class, which is immutable. The previous message claimed the column didn't exist which is misleading. Fixes: #7432 Change-Id: If0e2cbd3f763dca6c99a18aa42252c69f1207d59
* | use the options from the cached statement for propagate_optionsMike Bayer2021-12-123-114/+170
| | | | | | | | | | | | | | | | | | | | | | Fixed caching-related issue where the use of a loader option of the form ``lazyload(aliased(A).bs).joinedload(B.cs)`` would fail to result in the joinedload being invoked for runs subsequent to the query being cached, due to a mismatch for the options / object path applied to the objects loaded for a query with a lead entity that used ``aliased()``. Fixes: #7447 Change-Id: I4e9c34654b7d3668cd8878decbd688afe2af5f81
* | Fix referenced ticket number (#7439)Nils Philippsen2021-12-111-1/+1
| | | | | | Signed-off-by: Nils Philippsen <nils@tiptoe.de>
* | Merge "Add execution options to ``Session.get``" into mainFederico Caselli2021-12-114-0/+40
|\ \
| * | Add execution options to ``Session.get``Federico Caselli2021-12-104-0/+40
| | | | | | | | | | | | | | | Fixes: #7410 Change-Id: Iab6427b8b4c2ada8c31ef69f92d27c1185dbb6b1
* | | Merge "Add async_engine_from_config()" into mainFederico Caselli2021-12-115-0/+44
|\ \ \
| * | | Add async_engine_from_config()Nils Philippsen2021-12-105-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added :func:`_asyncio.async_engine_config` function to create an async engine from a configuration dict. This otherwise behaves the same as :func:`_sa.engine_from_config`. Fixes: #7301 Closes: #7302 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7302 Pull-request-sha: c7c758833b6c37b7509b8c5bed4f26ac0ccc0395 Change-Id: I64feadf95b5015c24fe0fa0dbae6755b72d1713e
* | | | Merge "Add ``scalars`` to Migration - ORM Usage table." into mainmike bayer2021-12-101-5/+8
|\ \ \ \
| * | | | Add ``scalars`` to Migration - ORM Usage table.Federico Caselli2021-12-091-5/+8
| | |/ / | |/| | | | | | | | | | | | | | | | | | Fixes #7407 Change-Id: I0ec7c0dd44dce3b907296824ee4e6103bc72a6dd
* | | | Merge "Removals: strings for join(), loader_options()." into mainmike bayer2021-12-1011-2303/+269
|\ \ \ \ | |_|/ / |/| | |
| * | | Removals: strings for join(), loader_options().Mike Bayer2021-12-0811-2303/+269
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The :meth:`_orm.Query.join` method no longer accepts strings for relationship names; the long-documented approach of using ``Class.attrname`` for join targets is now standard. * Loader options no longer accept strings for attribute names. The long-documented approach of using ``Class.attrname`` for loader option targets is now standard. It is hoped that a subsequent commit can refactor loader options to no longer need "UnboundLoad" for most cases. Change-Id: If4629882c40523dccbf4459256bf540fb468b618 References: #6986
* | | | Merge branch 'postgresql-docs-update-table-numbers' into main_gerritFederico Caselli2021-12-101-4/+4
|\ \ \ \ | | | | | | | | | | | | | | | Change-Id: Iac125101206ac78fb8344fd190b05e3d41151eee
| * | | | Update references to tables in PostgreSQL documentationLeo Singer2021-12-101-4/+4
|/ / / / | | | | | | | | | | | | | | | | Since the table numbers change from one version of PostgreSQL to the next, refer to the tables by name rather than by number.
* | | | Include import error message when greenlet is not installedFederico Caselli2021-12-091-2/+6
| |/ / |/| | | | | | | | | | | Fixes: #7419 Change-Id: I0c604875a80287acff3bab732f67601a5e2db98c
* | | cherry-pick changelog update for 1.4.29Mike Bayer2021-12-091-0/+4
| | |
* | | cherry-pick changelog from 1.4.28Mike Bayer2021-12-0916-214/+214
| | |
* | | Merge branch 'typos-fixes' into main_gerritFederico Caselli2021-12-092-2/+2
|\ \ \ | | | | | | | | | | | | Change-Id: I32a4c97add07a3fe7d2d5cc4f1cd263b2042e123
| * | | Fix typo in docstringLele Gaifax2021-12-091-1/+1
| | | |
| * | | Fix typo in changelogLele Gaifax2021-12-091-1/+1
| | | |
* | | | implement attributes.Proxy._clone()Mike Bayer2021-12-093-0/+80
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where the internal cloning used by the :meth:`_orm.PropComparator.any` method on a :func:`_orm.relationship` in the case where the related class also makes use of ORM polymorphic loading, would fail if a hybrid property on the related, polymorphic class were used within the criteria for the ``any()`` operation. Fixes: #7425 Change-Id: I5f4f4ec5fab17df228bc6e3de412d24114b20600
* | | changelog updatesMike Bayer2021-12-093-2/+3
| |/ |/| | | | | Change-Id: Ie136cfb7375e68b2badba1099b5b041f99da85fa
* | include correct notes for 2.0Mike Bayer2021-12-081-1/+1
|/ | | | | | | | the changelog_20 file either started out wrong or got changed at some point to include the wrong change notes, so the unreleased_20/ notes were not being displayed. Change-Id: Iecb0db86ba5c6bacf4f8fdf8876dc411f357d6df
* Merge "Warn when caching is disabled / document" into mainmike bayer2021-12-0745-78/+979
|\
| * Warn when caching is disabled / documentMike Bayer2021-12-0645-78/+979
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds new warnings for all elements that don't indicate their caching behavior, including user-defined ClauseElement subclasses and third party dialects. it additionally adds new documentation to discuss an apparent performance degradation in 1.4 when caching is disabled as a result in the significant expense incurred by ORM lazy loaders, which in 1.3 used BakedQuery so were actually cached. As a result of adding the warnings, a fair degree of lesser used SQL expression objects identified that they did not define caching behavior so would have been producing ``[no key]``, including PostgreSQL constructs ``hstore`` and ``array``. These have been amended to use inherit cache where appropriate. "on conflict" constructs in PostgreSQL, MySQL, SQLite still explicitly don't generate a cache key at this time. The change also adds a test for all constructs via assert_compile() to assert they will not generate cache warnings. Fixes: #7394 Change-Id: I85958affbb99bfad0f5efa21bc8f2a95e7e46981
* | Merge "contextmanager skips rollback if trans says to skip it" into mainmike bayer2021-12-076-2/+114
|\ \
| * | contextmanager skips rollback if trans says to skip itMike Bayer2021-12-066-2/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where if an exception occurred when the :class:`_orm.Session` were to close the connection within the :meth:`_orm.Session.commit` method, when using a context manager for :meth:`_orm.Session.begin` , it would attempt a rollback which would not be possible as the :class:`_orm.Session` was in between where the transaction is committed and the connection is then to be returned to the pool, raising the exception "this sessiontransaction is in the committed state". This exception can occur mostly in an asyncio context where CancelledError can be raised. Fixes: #7388 Change-Id: I1a85a3a7eae79f3553ddf1e3d245a0d90b0a2f40
* | | Merge "Add __copy__, __deepcopy__ to URL. Fixes: #7400" into mainmike bayer2021-12-063-0/+54
|\ \ \
| * | | Add __copy__, __deepcopy__ to URL. Fixes: #7400Tom Ritchford2021-12-063-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for ``copy()`` and ``deepcopy()`` to the :class:`_url.URL` class. Pull request courtesy Tom Ritchford. Fixes: #7400 Closes: #7401 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7401 Pull-request-sha: a2c1b8992f5d153c6210178cda47b8ae96b91fb5 Change-Id: I55977338b2655a7d4f733ae786d31e589185e9ca
* | | | qualify the stringification warningMike Bayer2021-12-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the recipe which uses render_postcompile itself is not insecure as it still renders bound parameters and does not stringify any literal values. Change-Id: Ib5ac2f7ce37dc1415a67b117a9c31c0ee37270b3
* | | | fix typo in exists documentationFederico Caselli2021-12-051-1/+1
| | | | | | | | | | | | | | | | Change-Id: I44d8d6ee4816052a8dda64c00905b17b7ad8698e
* | | | Merge "The where method of exists now accepts multiple cluase." into mainmike bayer2021-12-053-2/+23
|\ \ \ \ | |/ / / |/| | |
| * | | The where method of exists now accepts multiple cluase.Federico Caselli2021-12-043-2/+23
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Support multiple clause elements in the :meth:`_sql.Exists.where` method, unifying the api with the on presented by a normal :func:`_sql.select` construct. Fixes: #7386 Change-Id: I5df20478008cd5167053d357cbfad8a641c62b44
* | | Remove reference in docs to ThreadLocalMetaData which was removedFederico Caselli2021-12-041-6/+0
|/ / | | | | | | | | | | in e88dc004e6bcd1418cb8eb811d0aa580c2a44b8f Change-Id: I1ec3131b35ff62ccc8dc5489238b11d70623cbdc
* | Merge "Removals: MetaData.bind, Table.bind, all other .bind" into mainmike bayer2021-12-0319-1117/+125
|\ \
| * | Removals: MetaData.bind, Table.bind, all other .bindMike Bayer2021-12-0219-1117/+125
| |/ | | | | | | | | Change-Id: I1ef2eb2018f4b68825fe40a2a8d99084cf217b35 References: #7257
* | Merge "copy list for __iadd__" into mainmike bayer2021-12-033-2/+23
|\ \
| * | copy list for __iadd__Mike Bayer2021-12-023-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where a list mapped with :func:`_orm.relationship` would go into an endless loop if in-place added to itself, i.e. the ``+=`` operator were used, as well as if ``.extend()`` were given the same list. Fixes: #7389 Change-Id: Idd5118420f8bc684d1ee36b2b6d4c5812f36cc4c
* | | Merge "Add __class_getitem__ to the declarative Base class" into mainmike bayer2021-12-023-0/+36
|\ \ \ | |/ / |/| |
| * | Add __class_getitem__ to the declarative Base classKai Mueller2021-12-013-0/+36
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where the :func:`_orm.as_declarative` decorator and similar functions used to generate the declarative base class would not copy the ``__class_getitem__()`` method from a given superclass, which prevented the use of pep-484 generics in conjunction with the ``Base`` class. Pull request courtesy Kai Mueller. Fixes: #7368 Closes: #7381 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7381 Pull-request-sha: 7db7fd869a6bb617f767fad5b71ddf7cb5f14ff5 Change-Id: I495718c3082ad6dd2c83fdbf6feba7c529e351cb
* | fix typo in documentationFederico Caselli2021-12-011-1/+1
|/ | | | Change-Id: I620977b0665d9b3c2cc9ade9db475c357f537ff9
* Merge "Fixes: #4390" into mainmike bayer2021-11-305-6/+114
|\
| * Fixes: #4390jonathan vanasco2021-11-085-6/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated an undocumented loader option syntax ``".*"``, which appears to be no different than passing a single asterisk, and will emit a deprecation warning if used. This syntax may have been intended for something but there is currently no need for it. The original ticket was to document the `.{WILDCARD}` (e.g. `.*`) format, however this format does not appear to be used or needed by SQLAlchemy and is likely not used by any projects or developers. This PR invokes `util.warn_deprecated` to notify users this functionality is deprecated, and directs them to the #4390 issue if they actually use it. Assuming there are no complaints over this warning in the coming months, this code can be removed in a future major release. Change-Id: I665e3ac26be0a7819246a2ee56fb5a5f32980c91