summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge "remove declarative warnings"mike bayer2021-09-302-5/+1
|\ \ \
| * | | remove declarative warningsMike Bayer2021-09-292-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * sqlalchemy.ext.declarative names * declarative_base(bind) Change-Id: I0ca26894b224458b58e46504c5ff7b5d3031a829
* | | | Merge branch 'master' of ssh://gerrit.sqlalchemy.org:29418/sqlalchemy/sqlalchemyMike Bayer2021-09-292-0/+4
|\ \ \ \ | | | | | | | | | | | | | | | Change-Id: I610fecd5f40742db43de0a92e2b61a96f0ef1963
| * | | | Add missing methods added in :ticket:`6991`Federico Caselli2021-09-282-0/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | to ``scoped_session`` and ``async_scoped_session``. Fixes: #7103 Change-Id: If80481771d9b428f2403af3862e0479bd069257e
* | | | clarifies that @reconstructor only applies to a single methodE. Seiver2021-09-291-1/+1
|/ / /
* | | Merge "warn or deprecate for auto-aliasing in joins"mike bayer2021-09-287-51/+161
|\ \ \
| * | | warn or deprecate for auto-aliasing in joinsMike Bayer2021-09-287-51/+161
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An extra layer of warning messages has been added to the functionality of :meth:`_orm.Query.join` and the ORM version of :meth:`_sql.Select.join`, where a few places where "automatic aliasing" continues to occur will now be called out as a pattern to avoid, mostly specific to the area of joined table inheritance where classes that share common base tables are being joined together without using explicit aliases. One case emits a legacy warning for a pattern that's not recommended, the other case is fully deprecated. The automatic aliasing within ORM join() which occurs for overlapping mapped tables does not work consistently with all APIs such as ``contains_eager()``, and rather than continue to try to make these use cases work everywhere, replacing with a more user-explicit pattern is clearer, less prone to bugs and simplifies SQLAlchemy's internals further. The warnings include links to the errors.rst page where each pattern is demonstrated along with the recommended pattern to fix. * Improved the exception message generated when configuring a mapping with joined table inheritance where the two tables either have no foreign key relationships set up, or where they have multiple foreign key relationships set up. The message is now ORM specific and includes context that the :paramref:`_orm.Mapper.inherit_condition` parameter may be needed particularly for the ambiguous foreign keys case. * Add explicit support in the _expect_warnings() assertion for nested _expect_warnings calls * generalize the NoCache fixture, which we also need to catch warnings during compilation consistently * generalize the __str__() method for the HasCode mixin so all warnings and errors include the code link in their string Fixes: #6974 Change-Id: I84ed79ba2112c39eaab7973b6d6f46de7fa80842
* | | Merge "Fixes: #5151"mike bayer2021-09-281-1/+6
|\ \ \
| * | | Fixes: #5151jonathan vanasco2021-09-271-1/+6
| | |/ | |/| | | | | | | | | | | | | document `listen=True` on `before_create` Change-Id: I0804ee073044d879eb0decafeb1b358741d69f02
* | | Merge "Fixes: #2937"mike bayer2021-09-282-21/+73
|\ \ \ | |/ / |/| |
| * | Fixes: #2937jonathan vanasco2021-09-282-21/+73
| | | | | | | | | | | | | | | | | | | | | * docs for event listen kwargs * docs for mysql to use `listen` for changing the sql_mode` Change-Id: I7c1678488658edda3c5baaf0f7648108e93a4be1
* | | Fix typo introduced in #3086/I44c1a021a3e7ab7d66fea2d79a36cb2195a1969djonathan vanasco2021-09-271-1/+1
| |/ |/| | | | | | | | | Thank you @lelit Change-Id: I98e8e0fca25d6de6c7fa6c8c0ee429e80b14c102
* | Fixes: #3086jonathan vanasco2021-09-231-0/+27
|/ | | | | | show that `server_defaults` can accept contextually valid SQLAlchemy expressions or constructs Change-Id: I44c1a021a3e7ab7d66fea2d79a36cb2195a1969d
* Version 1.4.26 placeholderMike Bayer2021-09-221-1/+1
|
* Version 1.4.25 placeholderMike Bayer2021-09-221-1/+1
|
* changelog, doc editsMike Bayer2021-09-221-8/+12
| | | | Change-Id: Iafb50de7e28626d9cee755db9c05ac7189b4d963
* Merge "coerce for multivalues keys"mike bayer2021-09-222-7/+26
|\
| * coerce for multivalues keysMike Bayer2021-09-212-7/+26
| | | | | | | | | | | | | | | | | | Fixed issue where using ORM column expressions as keys in the list of dictionaries passed to :meth:`_sql.Insert.values` for "multi-valued insert" would not be processed correctly into the correct column expressions. Fixes: #7060 Change-Id: I1c4c286c33ea6eeaafba617996828f5c88ff0a1c
* | Merge "implement _all_selected_columns for functionelement"mike bayer2021-09-221-1/+12
|\ \
| * | implement _all_selected_columns for functionelementMike Bayer2021-09-201-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | Implemented a method in ``FunctionElement`` that is essentially abstract in an ancestor class (even though not used), leading to pylint complaints. Fixes: #7052 Change-Id: Iceeeb332fbb3c7187cd2b1969e2f4233a47136b1
* | | Merge "include setup_joins targets when scanning for FROM objects to clone"mike bayer2021-09-221-0/+34
|\ \ \ | |_|/ |/| |
| * | include setup_joins targets when scanning for FROM objects to cloneMike Bayer2021-09-201-0/+34
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed a two issues where combinations of ``select()`` and ``join()`` when adapted to form a copy of the element would not completely copy the state of all column objects associated with subqueries. A key problem this caused is that usage of the :meth:`_sql.ClauseElement.params` method (which should probably be moved into a legacy category as it is inefficient and error prone) would leave copies of the old :class:`_sql.BindParameter` objects around, leading to issues in correctly setting the parameters at execution time. Fixes: #7055 Change-Id: Ib822a978a99561b4402da3fb727b370f5c58210b
* | add note to "quote" regarding case insensitive table reflectionMike Bayer2021-09-211-0/+6
| | | | | | | | | | | | | | | | | | this note basically states that the use case requested in issue #7026 is not supported. I'm not sure the note is going to otherwise make sense to anyone. Fixes: #7026 Change-Id: Ib7782afc9bc5dc0c43cfab9b1f969a55c43209fe
* | Merge "Relax the Python version check for `__class_getitem__` tests"mike bayer2021-09-201-3/+3
|\ \ | |/ |/|
| * Relax the Python version check for `__class_getitem__` testslayday2021-09-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description `__class_getitem__` to support generics was introduced in Python 3.7. In 3.9 some built-ins were made generic but the functionality for user-defined classes has been there since 3.7. ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #7049 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7049 Pull-request-sha: 7bd16d416db010e7140313fe326861cc263b8864 Change-Id: I4f45b9585d263636e613cc5c86e710fa31c7d283
* | clarify "encoding" parameter furtherMike Bayer2021-09-201-8/+16
|/ | | | | | | | | Prevent any reading of this parameter that would omit that it is not used under Python 3 and in Python 2 is not used very much either. Fixes: #7050 Change-Id: Iaf619f1ee164fc58afe710d11627ed6368d74343
* Merge "pin asyncmy>=0.2.0 and remove cursor close workarounds"mike bayer2021-09-181-18/+4
|\
| * pin asyncmy>=0.2.0 and remove cursor close workaroundsMike Bayer2021-09-181-18/+4
| | | | | | | | Change-Id: I9426e09e4fd21f9c94f3c89b199a7784d33b949f
| * add attribute sphinx is breaking onMike Bayer2021-09-171-1/+1
| | | | | | | | | | | | | | | | the hybridmethod internal seems to be confusing a recent version of sphinx autodoc, add attribute it's searching for. Change-Id: I27f671a51f857b62337cc2374bbc87383ae9710d
* | Surface driver connection object when using a proxied dialectFederico Caselli2021-09-1721-94/+324
|/ | | | | | | | | | | | | | | | | | | | | | | | | | Improve the interface used by adapted drivers, like the asyncio ones, to access the actual connection object returned by the driver. The :class:`_engine._ConnectionRecord` and :class:`_engine._ConnectionFairy` now have two new attributes: * ``dbapi_connection`` always represents a DBAPI compatible object. For pep-249 drivers, this is the DBAPI connection as it always has been, previously accessed under the ``.connection`` attribute. For asyncio drivers that SQLAlchemy adapts into a pep-249 interface, the returned object will normally be a SQLAlchemy adaption object called :class:`_engine.AdaptedConnection`. * ``driver_connection`` always represents the actual connection object maintained by the third party pep-249 DBAPI or async driver in use. For standard pep-249 DBAPIs, this will always be the same object as that of the ``dbapi_connection``. For an asyncio driver, it will be the underlying asyncio-only connection object. The ``.connection`` attribute remains available and is now a legacy alias of ``.dbapi_connection``. Fixes: #6832 Change-Id: Ib72f97deefca96dce4e61e7c38ba430068d6a82e
* vendor asynccontextmanagerMike Bayer2021-09-173-3/+67
| | | | | | | while we still support python 3.6 vendor a simple version of this for now in the one place we currently use it. Change-Id: Ibcfc8b004b17e2ac79f9123ccb76c5eb25243f90
* Merge "Add `asyncmy` support"mike bayer2021-09-175-11/+351
|\
| * Add `asyncmy` supportlong2ice2021-09-175-11/+351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added initial support for the ``asyncmy`` asyncio database driver for MySQL and MariaDB. This driver is very new, however appears to be the only current alternative to the ``aiomysql`` driver which currently appears to be unmaintained and is not working with current Python versions. Much thanks to long2ice for the pull request for this dialect. Fixes: #6993 Closes: #7000 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7000 Pull-request-sha: f7d6c811fc72324a83c8af635bbca8b268b0098e Change-Id: I4ef54b43334feff7e3a710fc4de6821437f3bb68
* | Implement nesting CTEEric Masseran2021-09-173-28/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new parameter :meth:`_sql.HasCte.cte.nesting` to the :class:`_sql.CTE` constructor and :meth:`_sql.HasCTE.cte` method, which flags the CTE as one which should remain nested within an enclosing CTE, rather than being moved to the top level of the outermost SELECT. While in the vast majority of cases there is no difference in SQL functionality, users have identified various edge-cases where true nesting of CTE constructs is desirable. Much thanks to Eric Masseran for lots of work on this intricate feature. Fixes: #4123 Closes: #6709 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6709 Pull-request-sha: 64ab2f6ea269f2dcf37376a13ea38c48c5226fb6 Change-Id: Ic4dc25ab763af96d96632369e01527d48a654149
* | use the stack for insert_from_selectMike Bayer2021-09-162-5/+12
|/ | | | | | | | | Fixed issue related to new ``add_cte()`` feature where pairing two "INSERT..FROM SELECT" statements simultaneously would lose track of the two independent SELECT statements, leading to the wrong SQL. Fixes: #7036 Change-Id: I90fe47eb203bc5c1ea5810db0edba08250b2b7e6
* Merge "Fixes: #5289"mike bayer2021-09-151-1/+2
|\
| * Fixes: #5289jonathan vanasco2021-09-081-1/+2
| | | | | | | | | | | | Clarify Foreign Key support on SQLite must be enabled before `MetaData.create_all` Change-Id: Ic41b86f736be21dd6fc890a915a2ffd572df73a4
* | Merge "Fixes: #6930"mike bayer2021-09-155-0/+14
|\ \
| * | Fixes: #6930jonathan vanasco2021-09-085-0/+14
| |/ | | | | | | | | | | Note in docstrings that ignored kwargs are required for API conformance. Change-Id: Icc9a8c63c0936a7c5255841ef49d10a83496763a
* | Merge "Add scalars method to connection and session classes"mike bayer2021-09-154-0/+150
|\ \
| * | Add scalars method to connection and session classesMiguel Grinberg2021-09-144-0/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added new methods :meth:`_orm.Session.scalars`, :meth:`_engine.Connection.scalars`, :meth:`_asyncio.AsyncSession.scalars` and :meth:`_asyncio.AsyncSession.stream_scalars`, which provide a short cut to the use case of receiving a row-oriented :class:`_result.Result` object and converting it to a :class:`_result.ScalarResult` object via the :meth:`_engine.Result.scalars` method, to return a list of values rather than a list of rows. The new methods are analogous to the long existing :meth:`_orm.Session.scalar` and :meth:`_engine.Connection.scalar` methods used to return a single value from the first row only. Pull request courtesy Miguel Grinberg. Fixes: #6990 Closes: #6991 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6991 Pull-request-sha: b3e0bb3042c55b0cc5af6a25cb3f31b929f88a47 Change-Id: Ia445775e24ca964b0162c2c8e5ca67dd1e39199f
* | | Merge "Ensure str is callect on the URL password."mike bayer2021-09-142-14/+48
|\ \ \ | |/ / |/| |
| * | Ensure str is callect on the URL password.Federico Caselli2021-09-132-14/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that ``str()`` is called on the an ``URL.password`` argument, allowing usage of objects that implement the ``__str__()`` method as password attributes. Also clarified that one such object is not appropriate to dynamically change the password. Fixes: #6958 Change-Id: Id0690990a64b9e0935537b7b8f5a73efe6a9e3dc
* | | Fix various lib / test / examples typos (#7017)Kevin Kirsche2021-09-1112-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * fix: lib/sqlalchemy/sql/lambdas.py * fix: lib/sqlalchemy/sql/compiler.py * fix: lib/sqlalchemy/sql/selectable.py * fix: lib/sqlalchemy/orm/relationships.py * fix: lib/sqlalchemy/dialects/mssql/base.py * fix: lib/sql/test_compiler.py * fix: lib/sqlalchemy/testing/requirements.py * fix: lib/sqlalchemy/orm/path_registry.py * fix: lib/sqlalchemy/dialects/postgresql/psycopg2.py * fix: lib/sqlalchemy/cextension/immutabledict.c * fix: lib/sqlalchemy/cextension/resultproxy.c * fix: ./lib/sqlalchemy/dialects/oracle/cx_oracle.py * fix: examples/versioned_rows/versioned_rows_w_versionid.py * fix: examples/elementtree/optimized_al.py * fix: test/orm/test_attribute.py * fix: test/sql/test_compare.py * fix: test/sql/test_type_expression.py * fix: capitalization in test/dialect/mysql/test_compiler.py * fix: typos in test/dialect/postgresql/test_reflection.py * fix: typo in tox.ini comment * fix: typo in /lib/sqlalchemy/orm/decl_api.py * fix: typo in test/orm/test_update_delete.py * fix: self-induced typo * fix: typo in test/orm/test_query.py * fix: typos in test/dialect/mssql/test_types.py * fix: typo in test/sql/test_types.py
* | | Merge "ignore and warn for native_enum=False with pg.ENUM datatype"mike bayer2021-09-101-0/+8
|\ \ \
| * | | ignore and warn for native_enum=False with pg.ENUM datatypeMike Bayer2021-09-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | any UPPERCASE datatype refers to that exact type name rendered on the database. So PG's ENUM must render "ENUM" and is "native" by definition. warn if this flag is passed. The :class:`_postgresql.ENUM` datatype is PostgreSQL-native and therefore should not be used with the ``native_enum=False`` flag. This flag is now ignored if passed to the :class:`_postgresql.ENUM` datatype and a warning is emitted; previously the flag would cause the type object to fail to function correctly. Fixes: #6106 Change-Id: I08e0ec6fcfafd068e1eaf6aec13c8010f09ce94a
* | | | Merge "Modernize tests - remaining DML"mike bayer2021-09-101-7/+0
|\ \ \ \
| * | | | Modernize tests - remaining DMLGord Thompson2021-08-121-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dialect_keyword_arguments preserve_parameter_order Change-Id: I92efce4689635ef4b68fc02100c0c10aff9a0edc
* | | | | Merge "turn off deduping for col expressions"mike bayer2021-09-102-12/+19
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | turn off deduping for col expressionsMike Bayer2021-09-042-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed ORM issue where column expressions passed to ``query()`` or ORM-enabled ``select()`` would be deduplicated on the identity of the object, such as a phrase like ``select(A.id, null(), null())`` would produce only one "NULL" expression, which previously was not the case in 1.3. However, the change also allows for ORM expressions to render as given as well, such as ``select(A.data, A.data)`` will produce a result row with two columns. Fixes: #6979 Change-Id: I4dd59d4c7b1baa711b686379eb959f87c44841c4