]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
2 years agolink to with_variant() narrative from API doc
Mike Bayer [Tue, 3 Jan 2023 14:48:06 +0000 (09:48 -0500)] 
link to with_variant() narrative from API doc

Change-Id: I5d8e4d7cb7871bedebe0fe89758be441e64b94c6

2 years agoexclude pk update tests for mssql
Mike Bayer [Thu, 29 Dec 2022 19:07:32 +0000 (14:07 -0500)] 
exclude pk update tests for mssql

Change-Id: I817dacc30143fd54126cd7fe92429af858605259

2 years agoRectify reference to class LambdaElement, misnamed as LamdaElement (#9037)
Lele Gaifax [Thu, 29 Dec 2022 09:21:09 +0000 (10:21 +0100)] 
Rectify reference to class LambdaElement, misnamed as LamdaElement (#9037)

Fixes #9034.

(cherry picked from commit 532373b18f2e77910bb642a27a2cca3179499389)

2 years agoVersion 2.0.0rc2 placeholder
Mike Bayer [Wed, 28 Dec 2022 21:01:23 +0000 (16:01 -0500)] 
Version 2.0.0rc2 placeholder

2 years ago- 2.0.0rc1 rel_2_0_0rc1
Mike Bayer [Wed, 28 Dec 2022 20:55:29 +0000 (15:55 -0500)] 
- 2.0.0rc1

2 years agonote that 2.0 has behavioral changes outside of the 1.4->2.0 process
Mike Bayer [Wed, 28 Dec 2022 20:53:03 +0000 (15:53 -0500)] 
note that 2.0 has behavioral changes outside of the 1.4->2.0 process

Change-Id: I0ab9611c75f592acec73ca92271f970eae74d7ab

2 years agochangelog adjustments
Mike Bayer [Wed, 28 Dec 2022 20:30:32 +0000 (15:30 -0500)] 
changelog adjustments

include backport markings

Change-Id: I810923a641977569b8b4d9967e84b8cb684e7a52

2 years agoMerge "ensure whereclause, returning copied as tuples" into main
mike bayer [Wed, 28 Dec 2022 20:31:06 +0000 (20:31 +0000)] 
Merge "ensure whereclause, returning copied as tuples" into main

2 years agoType annotations for sqlalchemy.orm.events
Gleb Kisenkov [Wed, 28 Dec 2022 19:23:23 +0000 (14:23 -0500)] 
Type annotations for sqlalchemy.orm.events

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
An attempt to annotate `lib/sqlalchemy/orm/events.py` with type hints (issue #6810).

### 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
- [ ] 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.
- [x] 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: #9025
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/9025
Pull-request-sha: a3fd2c0c3790164c433305ccc7ac6b73e813e037

Change-Id: I0808b6485504615fa20691dc8f4631d38bc89ab3

2 years agoensure whereclause, returning copied as tuples
Mike Bayer [Wed, 28 Dec 2022 17:04:07 +0000 (12:04 -0500)] 
ensure whereclause, returning copied as tuples

Fixed issue in the internal SQL traversal for DML statements like
:class:`_dml.Update` and :class:`_dml.Delete` which would cause among other
potential issues, a specific issue using lambda statements with the ORM
update/delete feature.

Fixes: #9033
Change-Id: I76428049cb767ba302fbea89555114bf63ab8687

2 years agoMerge "rename 2.0.0b5 to 2.0.0rc1" into main
mike bayer [Wed, 28 Dec 2022 00:01:58 +0000 (00:01 +0000)] 
Merge "rename 2.0.0b5 to 2.0.0rc1" into main

2 years agoMerge "remove errant NO_KEY symbol" into main
mike bayer [Wed, 28 Dec 2022 00:01:08 +0000 (00:01 +0000)] 
Merge "remove errant NO_KEY symbol" into main

2 years agorename 2.0.0b5 to 2.0.0rc1
Mike Bayer [Tue, 27 Dec 2022 22:28:36 +0000 (17:28 -0500)] 
rename 2.0.0b5 to 2.0.0rc1

it's hoped for 2.0.0 final to be next, in early January

Change-Id: If4285f0929f4a2895f2bc93d9e8336599b973bcf

2 years agoremove errant NO_KEY symbol
Mike Bayer [Tue, 27 Dec 2022 22:20:07 +0000 (17:20 -0500)] 
remove errant NO_KEY symbol

the symbol from base is used in the event API and is
passed along from attributes here.

for the additional use where it's an exception case for
attribute name as passed by hybrid, use a different symbol name.

Change-Id: I8c5c0e71d19185ebec64f2fcbfe1e9be74e54287

2 years agoestablish explicit join transaction modes
Mike Bayer [Tue, 20 Dec 2022 17:48:08 +0000 (12:48 -0500)] 
establish explicit join transaction modes

The behavior of "joining an external transaction into a Session" has been
revised and improved, allowing explicit control over how the
:class:`_orm.Session` will accommodate an incoming
:class:`_engine.Connection` that already has a transaction and possibly a
savepoint already established. The new parameter
:paramref:`_orm.Session.join_transaction_mode` includes a series of option
values which can accommodate the existing transaction in several ways, most
importantly allowing a :class:`_orm.Session` to operate in a fully
transactional style using savepoints exclusively, while leaving the
externally initiated transaction non-committed and active under all
circumstances, allowing test suites to rollback all changes that take place
within tests.

Additionally, revised the :meth:`_orm.Session.close` method to fully close
out savepoints that may still be present, which also allows the
"external transaction" recipe to proceed without warnings if the
:class:`_orm.Session` did not explicitly end its own SAVEPOINT
transactions.

Fixes: #9015
Change-Id: I31c22ee0fd9372fa0eddfe057e76544aee627107

2 years agoMerge "pass more contextual information to PyWrapper param create" into main
mike bayer [Tue, 27 Dec 2022 20:53:08 +0000 (20:53 +0000)] 
Merge "pass more contextual information to PyWrapper param create" into main

2 years agodont prefix ssl args with "ssl" in the ssl dict
Mike Bayer [Tue, 27 Dec 2022 20:51:06 +0000 (15:51 -0500)] 
dont prefix ssl args with "ssl" in the ssl dict

Fixes: #9031
Change-Id: I9ef077e7da5b2328a345f6526a6210ce82d807f6

2 years agopass more contextual information to PyWrapper param create
Mike Bayer [Tue, 27 Dec 2022 17:29:38 +0000 (12:29 -0500)] 
pass more contextual information to PyWrapper param create

Fixed issue in lambda SQL feature where the calculated type of a literal
value would not take into account the type coercion rules of the "compared
to type", leading to a lack of typing information for SQL expressions, such
as comparisons to :class:`.JSON` elements and similar.

Fixes: #9029
Change-Id: I381c8d7458d98ba762313dee9ec47a9c1881f74a

2 years agoMerge "reorganize pre_session_exec around do_orm_execute" into main
mike bayer [Mon, 26 Dec 2022 19:36:37 +0000 (19:36 +0000)] 
Merge "reorganize pre_session_exec around do_orm_execute" into main

2 years agoreorganize pre_session_exec around do_orm_execute
Mike Bayer [Sun, 18 Dec 2022 21:33:22 +0000 (16:33 -0500)] 
reorganize pre_session_exec around do_orm_execute

Allow do_orm_execute() events to both receive the complete
state of bind_argments, load_options, update_delete_options
as they do already, but also allow them to *change* all those
things via new execution options.   Options like autoflush,
populate_existing etc. can now be updated within a
do_orm_execute() hook and those changes will take effect
all the way through.

Took a few tries to get something that covers every case here,
in particular horizontal sharding which is consuming those
options as well as using context.invoke(), without excess
complexity.  The good news seems to be that a simple
reorg and replacing the "reentrant" boolean with
"is this before do_orm_execute is invoked" was all that was
needed.

As part of this we add a new "identity_token" option allowing
this option to be controlled from do_orm_execute() as well
as from the outside.

WIP

Fixes: #7837
Change-Id: I087728215edec8d1b1712322ab389e3f52ff76ba

2 years agoMerge "expand out Index if passed to "constraint"" into main
mike bayer [Fri, 23 Dec 2022 15:21:02 +0000 (15:21 +0000)] 
Merge "expand out Index if passed to "constraint"" into main

2 years agoimprove async_sessionmaker docs
Mike Bayer [Fri, 23 Dec 2022 14:09:44 +0000 (09:09 -0500)] 
improve async_sessionmaker docs

* illustrate patterns where the async_sessionmaker is being reused.
  if you are not reusing it, there is no point to making it
* fix reference to async_sessionmaker
* add typing

Change-Id: I22a260132b6e06574b5fe37af554829e38163de6

2 years agoexpand out Index if passed to "constraint"
Mike Bayer [Thu, 22 Dec 2022 23:14:31 +0000 (18:14 -0500)] 
expand out Index if passed to "constraint"

Fixed bug where the PostgreSQL
:paramref:`_postgresql.OnConflictClause.constraint` parameter would accept
an :class:`.Index` object, however would not expand this index out into its
individual index expressions, instead rendering its name in an ON CONFLICT
ON CONSTRAINT clause, which is not accepted by PostgreSQL; the "constraint
name" form only accepts unique or exclude constraint names. The parameter
continues to accept the index but now expands it out into its component
expressions for the render.

Fixes: #9023
Change-Id: I6baf243e26bfe578bf3f193c162dd7a623b6ede9

2 years agocheck for adapt to same class in AbstractRange
Mike Bayer [Wed, 21 Dec 2022 21:10:34 +0000 (16:10 -0500)] 
check for adapt to same class in AbstractRange

Fixed regression where newly revised PostgreSQL range types such as
:class:`_postgresql.INT4RANGE` could not be set up as the impl of a
:class:`.TypeDecorator` custom type, instead raising a ``TypeError``.

Fixes: #9020
Change-Id: Ib881c3c7f63d000f49a09185a8663659a9970aa9

2 years agoMerge "fix optimized tests, use backend=True" into main
mike bayer [Wed, 21 Dec 2022 01:32:10 +0000 (01:32 +0000)] 
Merge "fix optimized tests, use backend=True" into main

2 years agoMerge "add joins_implicitly to column_valued()" into main
mike bayer [Tue, 20 Dec 2022 20:48:33 +0000 (20:48 +0000)] 
Merge "add joins_implicitly to column_valued()" into main

2 years agofix optimized tests, use backend=True
Mike Bayer [Tue, 20 Dec 2022 16:14:26 +0000 (11:14 -0500)] 
fix optimized tests, use backend=True

A failure on one of these tests for older SQLite wasn't caught
because we did not have non-returning backends exercised

Change-Id: I4e4c96a33580942a6f82b00fc7dde83c56d4d881

2 years agoadd joins_implicitly to column_valued()
Mike Bayer [Mon, 19 Dec 2022 20:15:35 +0000 (15:15 -0500)] 
add joins_implicitly to column_valued()

Added parameter
:paramref:`.FunctionElement.column_valued.joins_implicitly`, which is
useful in preventing the "cartesian product" warning when making use of
table-valued or column-valued functions. This parameter was already
introduced for :meth:`.FunctionElement.table_valued` in :ticket:`7845`,
however it failed to be added for :meth:`.FunctionElement.column_valued`
as well.

Fixes: #9009
Change-Id: Ifb72fbcb4f4d2998e730d6f85ec7280df3bf3d47

2 years ago8393 will be backported to 1.4
Mike Bayer [Tue, 20 Dec 2022 15:49:29 +0000 (10:49 -0500)] 
8393 will be backported to 1.4

Change-Id: I54d17e8e74824826a856180c527159e0237605d4

2 years agoMerge "Add MACCADDR8 for PGCompiler" into main
mike bayer [Tue, 20 Dec 2022 15:47:30 +0000 (15:47 +0000)] 
Merge "Add MACCADDR8 for PGCompiler" into main

2 years agoMerge "remove __allow_unmapped__ requirement from dataclasses" into main
mike bayer [Mon, 19 Dec 2022 20:27:49 +0000 (20:27 +0000)] 
Merge "remove __allow_unmapped__ requirement from dataclasses" into main

2 years agoAdd MACCADDR8 for PGCompiler
asimfarooq5 [Wed, 14 Dec 2022 20:32:47 +0000 (15:32 -0500)] 
Add MACCADDR8 for PGCompiler

Add MACCADDR8 for PGCompiler

Closes: #8393
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8393
Pull-request-sha: 837a68eba3e31e0acbb7c47ee87bca4e9def7648

Change-Id: I87e4999eb8d82662ff8ab409c98dc57edd7fd271

2 years agoremove __allow_unmapped__ requirement from dataclasses
Mike Bayer [Sun, 18 Dec 2022 20:35:39 +0000 (15:35 -0500)] 
remove __allow_unmapped__ requirement from dataclasses

Removed the requirement that the ``__allow_unmapped__`` attribute be used
on Declarative Dataclass Mapped class when non-``Mapped[]`` annotations are
detected; previously, an error message that was intended to support legacy
ORM typed mappings would be raised, which additionally did not mention
correct patterns to use with Dataclasses specifically. This error message
is now no longer raised if :meth:`_orm.registry.mapped_as_dataclass` or
:class:`_orm.MappedAsDataclass` is used.

Fixes: #8973
Change-Id: I887afcc2da83dd904444bcb97f31e695b9f8b443

2 years agoadd exclusion for unusual chars in column names
Mike Bayer [Mon, 19 Dec 2022 13:34:51 +0000 (08:34 -0500)] 
add exclusion for unusual chars in column names

Added new exclusion rule for third party dialects called
``unusual_column_name_characters``, which can be "closed" for third party
dialects that don't support column names with unusual characters such as
dots, slashes, or percent signs in them, even if the name is properly
quoted.

Fixes: #9002
Change-Id: I44b765df4c73ce5ec1907d031fd9c89761fd99d1
References: #8993

2 years agoMerge "include pk cols in refresh() if relationships are requested" into main
mike bayer [Sun, 18 Dec 2022 20:02:39 +0000 (20:02 +0000)] 
Merge "include pk cols in refresh() if relationships are requested" into main

2 years agoinclude pk cols in refresh() if relationships are requested
Mike Bayer [Fri, 16 Dec 2022 20:44:32 +0000 (15:44 -0500)] 
include pk cols in refresh() if relationships are requested

A series of changes and improvements regarding
:meth:`_orm.Session.refresh`. The overall change is that primary key
attributes for an object are now included in a refresh operation
unconditionally when relationship-bound attributes are to be refreshed,
even if not expired and even if not specified in the refresh.

* Improved :meth:`_orm.Session.refresh` so that if autoflush is enabled
(as is the default for :class:`_orm.Session`), the autoflush takes place
at an earlier part of the refresh process so that pending primary key
changes are applied without errors being raised.  Previously, this
autoflush took place too late in the process and the SELECT statement
would not use the correct key to locate the row and an
:class:`.InvalidRequestError` would be raised.

* When the above condition is present, that is, unflushed primary key
changes are present on the object, but autoflush is not enabled,
the refresh() method now explicitly disallows the operation to proceed,
and an informative :class:`.InvalidRequestError` is raised asking that
the pending primary key changes be flushed first.  Previously,
this use case was simply broken and :class:`.InvalidRequestError`
would be raised anyway. This restriction is so that it's safe for the
primary key attributes to be refreshed, as is necessary for the case of
being able to refresh the object with relationship-bound secondary
eagerloaders also being emitted. This rule applies in all cases to keep
API behavior consistent regardless of whether or not the PK cols are
actually needed in the refresh, as it is unusual to be refreshing
some attributes on an object while keeping other attributes "pending"
in any case.

* The :meth:`_orm.Session.refresh` method has been enhanced such that
attributes which are :func:`_orm.relationship`-bound and linked to an
eager loader, either at mapping time or via last-used loader options,
will be refreshed in all cases even when a list of attributes is passed
that does not include any columns on the parent row. This builds upon the
feature first implemented for non-column attributes as part of
:ticket:`1763` fixed in 1.4 allowing eagerly-loaded relationship-bound
attributes to participate in the :meth:`_orm.Session.refresh` operation.
If the refresh operation does not indicate any columns on the parent row
to be refreshed, the primary key columns will nonetheless be included
in the refresh operation, which allows the load to proceed into the
secondary relationship loaders indicated as it does normally.
Previously an :class:`.InvalidRequestError` error would be raised
for this condition (:ticket:`8703`)

* Fixed issue where an unnecessary additional SELECT would be emitted in
the case where :meth:`_orm.Session.refresh` were called with a
combination of expired attributes, as well as an eager loader such as
:func:`_orm.selectinload` that emits a "secondary" query, if the primary
key attributes were also in an expired state.  As the primary key
attributes are now included in the refresh automatically, there is no
additional load for these attributes when a relationship loader
goes to select for them (:ticket:`8997`)

* Fixed regression caused by :ticket:`8126` released in 2.0.0b1 where the
:meth:`_orm.Session.refresh` method would fail with an
``AttributeError``, if passed both an expired column name as well as the
name of a relationship-bound attribute that was linked to a "secondary"
eagerloader such as the :func:`_orm.selectinload` eager loader
(:ticket:`8996`)

Fixes: #8703
Fixes: #8996
Fixes: #8997
Fixes: #8126
Change-Id: I88dcbc0a9a8337f6af0bc4bcc5b0261819acd1c4

2 years agoMerge "dont call platform.architecture()" into main
mike bayer [Sun, 18 Dec 2022 06:26:11 +0000 (06:26 +0000)] 
Merge "dont call platform.architecture()" into main

2 years agofix changelog for types, add date rendering to whatsnew
Mike Bayer [Sat, 17 Dec 2022 16:10:02 +0000 (11:10 -0500)] 
fix changelog for types, add date rendering to whatsnew

this change is likely somehting people want to see so make
it more prominent, also there's no "types" category in changelog
so these should be "sql".

Change-Id: I9104c210448f3ba0304f1e09d0613240fe8dcf4e
References: #8998

2 years agoMerge "ensure all visit methods accept **kw" into main
mike bayer [Sat, 17 Dec 2022 02:02:33 +0000 (02:02 +0000)] 
Merge "ensure all visit methods accept **kw" into main

2 years agoMerge "make bind escape lookup extensible" into main
mike bayer [Fri, 16 Dec 2022 19:37:51 +0000 (19:37 +0000)] 
Merge "make bind escape lookup extensible" into main

2 years agodont call platform.architecture()
Mike Bayer [Fri, 16 Dec 2022 19:05:48 +0000 (14:05 -0500)] 
dont call platform.architecture()

Fixed regression where the base compat module was calling upon
``platform.architecture()`` in order to detect some system properties,
which results in an over-broad system call against the system-level
``file`` call that is unavailable under some circumstances, including
within some secure environment configurations.

Fixes: #8995
Change-Id: Ib6171e75aff5a60a79dab81a0be21bee2456318b

2 years agoensure all visit methods accept **kw
Mike Bayer [Fri, 16 Dec 2022 17:16:21 +0000 (12:16 -0500)] 
ensure all visit methods accept **kw

Added test support to ensure that all compiler ``visit_xyz()`` methods
across all :class:`.Compiler` implementations in SQLAlchemy accept a
``**kw`` parameter, so that all compilers accept additional keyword
arguments under all circumstances.

Fixes: #8988
Change-Id: I1cefc313e4e64a10ee7dd14400137fbe02ce9523

2 years agomake bind escape lookup extensible
Mike Bayer [Fri, 16 Dec 2022 17:56:21 +0000 (12:56 -0500)] 
make bind escape lookup extensible

To accommodate for third party dialects with different character escaping
needs regarding bound parameters, the system by which SQLAlchemy "escapes"
(i.e., replaces with another character in its place) special characters in
bound parameter names has been made extensible for third party dialects,
using the :attr:`.SQLCompiler.bindname_escape_chars` dictionary which can
be overridden at the class declaration level on any :class:`.SQLCompiler`
subclass. As part of this change, also added the dot ``"."`` as a default
"escaped" character.

Fixes: #8994
Change-Id: I52fbbfa8c64497b123f57327113df3f022bd1419

2 years agoMerge "add eager_defaults="auto" for inserts" into main
mike bayer [Fri, 16 Dec 2022 16:56:56 +0000 (16:56 +0000)] 
Merge "add eager_defaults="auto" for inserts" into main

2 years agoMerge "implement literal_binds with expanding + bind_expression" into main
mike bayer [Fri, 16 Dec 2022 15:08:18 +0000 (15:08 +0000)] 
Merge "implement literal_binds with expanding + bind_expression" into main

2 years agoMerge "add explicit REGCONFIG, pg full text functions" into main
mike bayer [Fri, 16 Dec 2022 15:08:00 +0000 (15:08 +0000)] 
Merge "add explicit REGCONFIG, pg full text functions" into main

2 years agoMerge "Improved error message in orm annotated declarative" into main
mike bayer [Fri, 16 Dec 2022 15:01:06 +0000 (15:01 +0000)] 
Merge "Improved error message in orm annotated declarative" into main

2 years agoMerge "Improve v2 documentation" into main
mike bayer [Thu, 15 Dec 2022 22:32:15 +0000 (22:32 +0000)] 
Merge "Improve v2 documentation" into main

2 years agoadd eager_defaults="auto" for inserts
Mike Bayer [Fri, 9 Dec 2022 00:31:37 +0000 (19:31 -0500)] 
add eager_defaults="auto" for inserts

Added a new default value for the :paramref:`.Mapper.eager_defaults`
parameter "auto", which will automatically fetch table default values
during a unit of work flush, if the dialect supports RETURNING for the
INSERT being run, as well as
:ref:`insertmanyvalues <engine_insertmanyvalues>` available. Eager fetches
for server-side UPDATE defaults, which are very uncommon, continue to only
take place if :paramref:`.Mapper.eager_defaults` is set to ``True``, as
there is no batch-RETURNING form for UPDATE statements.

Fixes: #8889
Change-Id: I84b91092a37c4cd216e060513acde3eb0298abe9

2 years agoadd explicit REGCONFIG, pg full text functions
Mike Bayer [Wed, 14 Dec 2022 01:07:14 +0000 (20:07 -0500)] 
add explicit REGCONFIG, pg full text functions

Added support for explicit use of PG full text functions with asyncpg and
psycopg (SQLAlchemy 2.0 only), with regards to the ``REGCONFIG`` type cast
for the first argument, which previously would be incorrectly cast to a
VARCHAR, causing failures on these dialects that rely upon explicit type
casts. This includes support for :class:`_postgresql.to_tsvector`,
:class:`_postgresql.to_tsquery`, :class:`_postgresql.plainto_tsquery`,
:class:`_postgresql.phraseto_tsquery`,
:class:`_postgresql.websearch_to_tsquery`,
:class:`_postgresql.ts_headline`, each of which will determine based on
number of arguments passed if the first string argument should be
interpreted as a PostgreSQL "REGCONFIG" value; if so, the argument is typed
using a newly added type object :class:`_postgresql.REGCONFIG` which is
then explicitly cast in the SQL expression.

Fixes: #8977
Change-Id: Ib36698a984fd4194bd6e0eb663105f790f3db7d3

2 years agoimplement literal_binds with expanding + bind_expression
Mike Bayer [Thu, 15 Dec 2022 15:22:36 +0000 (10:22 -0500)] 
implement literal_binds with expanding + bind_expression

Fixed bug where SQL compilation would fail to make use of
:meth:`_types.TypeEngine.bind_expression` on a given type when used in the
context of an "expanding" (i.e. "IN") parameter with the ``literal_binds``
compiler parameter in use.

Fixes: #8989
Change-Id: Ic9fd27b46381b488117295ea5a492d8fc158e39f

2 years agoFix equality comparison between a PG Range and a different class instance
Lele Gaifax [Thu, 15 Dec 2022 09:27:03 +0000 (04:27 -0500)] 
Fix equality comparison between a PG Range and a different class instance

This fixes issue #8984, making the method `Range.__eq__` return `NotImplemented` when the argument is an instance of a different class.

Closes: #8985
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8985
Pull-request-sha: b8f601f038a2203af02a99ab190ebbc1c489549a

Change-Id: Iaf0b651a22a9f346c8f18b3a53e3339bf61bb33f

2 years agoMerge "warn when backref will replace existing userland descriptor" into main
mike bayer [Wed, 14 Dec 2022 22:35:51 +0000 (22:35 +0000)] 
Merge "warn when backref will replace existing userland descriptor" into main

2 years agoImprove v2 documentation
Federico Caselli [Fri, 9 Dec 2022 18:08:19 +0000 (19:08 +0100)] 
Improve v2 documentation

Fixes: #7659
Change-Id: Ic9b758c7eed568f33dd0a745031f96de7666baf1

2 years agoImproved error message in orm annotated declarative
Federico Caselli [Wed, 14 Dec 2022 21:18:58 +0000 (22:18 +0100)] 
Improved error message in orm annotated declarative

Fixes: #8980
Change-Id: I32c4cf8715ee43fa8415f0102394ddd43b1fee0a

2 years agoMerge "catch all BaseException in pool and revert failed checkouts" into main
mike bayer [Wed, 14 Dec 2022 20:40:48 +0000 (20:40 +0000)] 
Merge "catch all BaseException in pool and revert failed checkouts" into main

2 years agowarn when backref will replace existing userland descriptor
Mike Bayer [Wed, 14 Dec 2022 18:49:11 +0000 (13:49 -0500)] 
warn when backref will replace existing userland descriptor

A warning is emitted if a backref name used in :func:`_orm.relationship`
names an attribute on the target class which already has a method or
attribute assigned to that name, as the backref declaration will replace
that attribute.

Fixes: #4629
Change-Id: I0059b35ce60f43b0f3d8be008f12411154484ea1

2 years agocheck index_list pragma for number of columns returned
Mike Bayer [Mon, 12 Dec 2022 23:05:07 +0000 (18:05 -0500)] 
check index_list pragma for number of columns returned

Fixed regression caused by new support for reflection of partial indexes on
SQLite added in 1.4.45 for :ticket:`8804`, where the ``index_list`` pragma
command in very old versions of SQLite (possibly prior to 3.8.9) does not
return the current expected number of columns, leading to exceptions raised
when reflecting tables and indexes.

Fixes: #8969
Change-Id: If317cdcfc6782f7e180df329b6ea0ddb48ce2269

2 years agocatch all BaseException in pool and revert failed checkouts
Mike Bayer [Mon, 12 Dec 2022 18:47:27 +0000 (13:47 -0500)] 
catch all BaseException in pool and revert failed checkouts

Fixed a long-standing race condition in the connection pool which could
occur under eventlet/gevent monkeypatching schemes in conjunction with the
use of eventlet/gevent ``Timeout`` conditions, where a connection pool
checkout that's interrupted due to the timeout would fail to clean up the
failed state, causing the underlying connection record and sometimes the
database connection itself to "leak", leaving the pool in an invalid state
with unreachable entries. This issue was first identified and fixed in
SQLAlchemy 1.2 for :ticket:`4225`, however the failure modes detected in
that fix failed to accommodate for ``BaseException``, rather than
``Exception``, which prevented eventlet/gevent ``Timeout`` from being
caught. In addition, a block within initial pool connect has also been
identified and hardened with a ``BaseException`` -> "clean failed connect"
block to accommodate for the same condition in this location.
Big thanks to Github user @niklaus for their tenacious efforts in
identifying and describing this intricate issue.

Fixes: #8974
Change-Id: I95a0e1f080d0cee6f1a66977432a586fdf87f686

2 years agoType annotations for sqlalchemy.ext.horizontal_shard
Gleb Kisenkov [Thu, 8 Dec 2022 22:48:55 +0000 (17:48 -0500)] 
Type annotations for sqlalchemy.ext.horizontal_shard

The horizontal sharding extension is now pep-484 typed. Thanks to Gleb
Kisenkov for their efforts on this.

Closes: #8948
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8948
Pull-request-sha: e40e768492685aa9ce57c4762c571f935e3fd3c7

Change-Id: I2374e174c9433846c453c20a37ec5e5584fd3b31

2 years agoadd color directives
Mike Bayer [Sun, 11 Dec 2022 20:47:25 +0000 (15:47 -0500)] 
add color directives

See https://tox.wiki/en/latest/faq.html#tox-4-known-regressions

Change-Id: I3c7291a660dc167bce3151e02cd123edc4707ca1

2 years agoadjust for tox changes to passenv
Mike Bayer [Sun, 11 Dec 2022 16:13:58 +0000 (11:13 -0500)] 
adjust for tox changes to passenv

Fixed issue in tox.ini file where changes in the tox 4.0 series to the
format of "passenv" caused tox to not function correctly, in particular
raising an error as of tox 4.0.6.

Change-Id: I659c8fc523a71deaa02a89103c9e7241cf81d831
References: https://github.com/tox-dev/tox/issues/2676

2 years agocherry-pick changelog update for 1.4.46
Mike Bayer [Sat, 10 Dec 2022 18:51:43 +0000 (13:51 -0500)] 
cherry-pick changelog update for 1.4.46

2 years agocherry-pick changelog from 1.4.45
Mike Bayer [Sat, 10 Dec 2022 18:51:42 +0000 (13:51 -0500)] 
cherry-pick changelog from 1.4.45

2 years agolook out for extras=None in freeze
Mike Bayer [Fri, 9 Dec 2022 20:56:15 +0000 (15:56 -0500)] 
look out for extras=None in freeze

Fixed issue where :meth:`_engine.Result.freeze` method would not work for
textual SQL using either :func:`_sql.text` or
:meth:`_engine.Connection.exec_driver_sql`.

Fixes: #8963
Change-Id: Ia131c6ac41a4adf32eb1bf1abf23930ef395f16c

2 years agofix typo
Mike Bayer [Fri, 9 Dec 2022 19:51:24 +0000 (14:51 -0500)] 
fix typo

Change-Id: I09d1d1c9505c1cad8ed21b675a105b0dbbb02e00

2 years agoMerge "Better syncronize async result docs with plain ones." into main
mike bayer [Fri, 9 Dec 2022 19:49:41 +0000 (19:49 +0000)] 
Merge "Better syncronize async result docs with plain ones." into main

2 years agoBetter syncronize async result docs with plain ones.
Federico Caselli [Thu, 8 Dec 2022 18:34:49 +0000 (19:34 +0100)] 
Better syncronize async result docs with plain ones.

Removed non-functional method ``merge`` from :class:`_asyncio.AsyncResult`.
This method was non-functional and non-testes since the first introduction
of asyncio in SQLAlchemy.

Fixes: #7158
Fixes: #8952
Change-Id: Ibc3d17be8a8b7cab9bf2074f0408f74b4c4b161d

2 years agoSpecify view columns in HasTableTest
Gord Thompson [Fri, 9 Dec 2022 16:55:34 +0000 (09:55 -0700)] 
Specify view columns in HasTableTest

Fixes: #8960
Avoid test errors on databases that do not
support CREATE VIEW vv AS SELECT * FROM

Change-Id: Ic9e892aa4466030b9b325c11228dad15cf59a258

2 years agofix construct_params() for render_postcompile; add new API
Mike Bayer [Thu, 8 Dec 2022 16:00:31 +0000 (11:00 -0500)] 
fix construct_params() for render_postcompile; add new API

The :meth:`.SQLCompiler.construct_params` method, as well as the
:attr:`.SQLCompiler.params` accessor, will now return the
exact parameters that correspond to a compiled statement that used
the ``render_postcompile`` parameter to compile.   Previously,
the method returned a parameter structure that by itself didn't correspond
to either the original parameters or the expanded ones.

Passing a new dictionary of parameters to
:meth:`.SQLCompiler.construct_params` for a :class:`.SQLCompiler` that was
constructed with ``render_postcompile`` is now disallowed; instead, to make
a new SQL string and parameter set for an alternate set of parameters, a
new method :meth:`.SQLCompiler.construct_expanded_state` is added which
will produce a new expanded form for the given parameter set, using the
:class:`.ExpandedState` container which includes a new SQL statement
and new parameter dictionary, as well as a positional parameter tuple.

Fixes: #6114
Change-Id: I9874905bb90f86799b82b244d57369558b18fd93

2 years agoMerge "disable polymorphic adaption in most cases" into main
mike bayer [Thu, 8 Dec 2022 00:25:34 +0000 (00:25 +0000)] 
Merge "disable polymorphic adaption in most cases" into main

2 years agodisable polymorphic adaption in most cases
Mike Bayer [Mon, 5 Dec 2022 21:11:59 +0000 (16:11 -0500)] 
disable polymorphic adaption in most cases

Improved a fix first made in version 1.4 for :ticket:`8456` which scaled
back the usage of internal "polymorphic adapters", that are used to render
ORM queries when the :paramref:`_orm.Mapper.with_polymorphic` parameter is
used. These adapters, which are very complex and error prone, are now used
only in those cases where an explicit user-supplied subquery is used for
:paramref:`_orm.Mapper.with_polymorphic`, which includes only the use case
of concrete inheritance mappings that use the
:func:`_orm.polymorphic_union` helper, as well as the legacy use case of
using an aliased subquery for joined inheritance mappings, which is not
needed in modern use.

For the most common case of joined inheritance mappings that use the
built-in polymorphic loading scheme, which includes those which make use of
the :paramref:`_orm.Mapper.polymorphic_load` parameter set to ``inline``,
polymorphic adapters are now no longer used. This has both a positive
performance impact on the construction of queries as well as a
substantial simplification of the internal query rendering process.

The specific issue targeted was to allow a :func:`_orm.column_property`
to refer to joined-inheritance classes within a scalar subquery, which now
works as intuitively as is feasible.

ORM context, mapper, strategies now use ORMAdapter in all cases
instead of straight ColumnAdapter; added some more parameters
to ORMAdapter to make this possible.  ORMAdapter now includes a
"trace" enumeration that identifies the use path for the
adapter and can aid in debugging.

implement __slots__ for the ExternalTraversal hierarchy up
to ORMAdapter.  Within this change, we have to change the
ClauseAdapter.wrap() method, which is only used in one polymorphic
codepath, to use copy.copy() instead of
`__dict__` access (apparently `__reduce_ex__` is implemented for
objects with `__slots__`), and we also remove pickling ability,
which should not be needed for adapters (this might have been needed
for 1.3 and earlier in order for Query to be picklable, but none
of that state is present within Query / select() / etc. anymore).

Fixes: #8168
Change-Id: I3f6593eb02ab5e5964807c53a9fa4894c826d017

2 years agoOracle COLUMN_VALUE is a column name, not a keyword
Mike Bayer [Wed, 7 Dec 2022 20:54:59 +0000 (15:54 -0500)] 
Oracle COLUMN_VALUE is a column name, not a keyword

Fixed issue in Oracle compiler where the syntax for
:meth:`.FunctionElement.column_valued` was incorrect, rendering the name
``COLUMN_VALUE`` without qualifying the source table correctly.

Fixes: #8945
Change-Id: Ia04bbdc68168e78b67a74bb3834a63f5d5000627

2 years agomove more Session weakref tests to test_memusage
Mike Bayer [Wed, 7 Dec 2022 19:23:45 +0000 (14:23 -0500)] 
move more Session weakref tests to test_memusage

py311 may be more sensitive here, or maybe the machines are
acting differently these days, in any case move
memory  / GC sensitive tests to test_memusage.

Change-Id: I218295150efc2f7ea88da9960ff10fda63dc60b1

2 years agosort materialize view names in test
Mike Bayer [Tue, 6 Dec 2022 21:31:30 +0000 (16:31 -0500)] 
sort materialize view names in test

saw this fail on CI with views in reverse order

Change-Id: I953f379f36924673a49b94cf5e7f54d071044113

2 years agotake mariadb-connector out of dbapi main job
Mike Bayer [Tue, 6 Dec 2022 14:08:55 +0000 (09:08 -0500)] 
take mariadb-connector out of dbapi main job

mariadb-connector seems to have their release situation "fixed",
but for 1.1.5post3 they are requiring mariadb-connector-c 3.3.1, Fedora 36
which is quite bleeding edge only has 3.2.7.    There's no way we
can easily have a version specifier that will look at underlying
client libraries.

since mariadb-connector's main branch seems to work way ahead of
where we will normally have client libraries set up, it's not really
worth testing in CI right now.

Change-Id: Idcb034da6d06620b5e212582bbc63a246a9fe58b

2 years agoVersion 2.0.0b5 placeholder
Mike Bayer [Mon, 5 Dec 2022 23:21:33 +0000 (18:21 -0500)] 
Version 2.0.0b5 placeholder

2 years ago- 2.0.0b4 rel_2_0_0b4
Mike Bayer [Mon, 5 Dec 2022 23:14:49 +0000 (18:14 -0500)] 
- 2.0.0b4

2 years agoMerge "Add tests for issue #8168; slight internal adjustments" into main
mike bayer [Mon, 5 Dec 2022 23:11:10 +0000 (23:11 +0000)] 
Merge "Add tests for issue #8168; slight internal adjustments" into main

2 years agoAdd tests for issue #8168; slight internal adjustments
Mike Bayer [Sun, 4 Dec 2022 17:02:37 +0000 (12:02 -0500)] 
Add tests for issue #8168; slight internal adjustments

The issue in #8168 was improved, but not completely fixed,
by #8456.

This includes some small changes to ORM context that
are a prerequisite for getting ORM adaptation to be
better.   Have these in 2.0.0b4 so that we have at
least a better starting point.

References: #8168
Change-Id: I51dbe333b156048836d074fbba1d850f9eb67fd2

2 years agochangelog updates
Mike Bayer [Mon, 5 Dec 2022 22:16:32 +0000 (17:16 -0500)] 
changelog updates

prep for 2.0.0b4

Change-Id: I2bf7249f6ed0c120b9d04d81eaecdf8593729c83
(cherry picked from commit 42876aabb5f893e1922676eb809e6b37c0519ed8)

2 years agorename some GitHub actions to use test names as prefix, as introduced in rel_1_4...
Jonathan Vanasco [Mon, 5 Dec 2022 22:08:10 +0000 (17:08 -0500)] 
rename some GitHub actions to use test names as prefix, as introduced in rel_1_4 (#8933)

Change-Id: I7f3aa96447ade605becbdef01bc19f3b78dbd6d1

2 years agoMerge "Add compatibility properties to Range; implement pep-484" into main
mike bayer [Mon, 5 Dec 2022 19:32:15 +0000 (19:32 +0000)] 
Merge "Add compatibility properties to Range; implement pep-484" into main

2 years agoAdd compatibility properties to Range; implement pep-484
Lele Gaifax [Mon, 5 Dec 2022 01:51:13 +0000 (20:51 -0500)] 
Add compatibility properties to Range; implement pep-484

This adds a bunch of properties to new PG Range class for compatibility
with other implementations, providing a more similar API to access
emptiness and bounds status.

The naming conventions here derive from PostgreSQL itself,
see https://www.postgresql.org/docs/9.3/functions-range.html .

pep-484 also implemented by Mike, as this is a pretty type-intensive
module.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Closes: #8927
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8927
Pull-request-sha: 8b9e7b7e3345673b43aeabd7ec88b88dc3cfa7eb

Change-Id: I0b1d49311517ee1cc1377a974ed0a860ea5756e4

2 years agoMerge "Rewrite positional handling, test for "numeric"" into main
mike bayer [Mon, 5 Dec 2022 16:29:52 +0000 (16:29 +0000)] 
Merge "Rewrite positional handling, test for "numeric"" into main

2 years agoRewrite positional handling, test for "numeric"
Federico Caselli [Fri, 2 Dec 2022 16:58:40 +0000 (11:58 -0500)] 
Rewrite positional handling, test for "numeric"

Changed how the positional compilation is performed. It's rendered by the compiler
the same as the pyformat compilation. The string is then processed to replace
the placeholders with the correct ones, and to obtain the correct order of the
parameters.
This vastly simplifies the computation of the order of the parameters, that in
case of nested CTE is very hard to compute correctly.

Reworked how numeric paramstyle behavers:
- added support for repeated parameter, without duplicating them like in normal
positional dialects
- implement insertmany support. This requires that the dialect supports out of
order placehoders, since all parameters that are not part of the VALUES clauses
are placed at the beginning of the parameter tuple
- support for different identifiers for a numeric parameter. It's for example
possible to use postgresql style placeholder $1, $2, etc

Added two new dialect based on sqlite to test "numeric" fully using
both :1 style and $1 style. Includes a workaround for SQLite's
not-really-correct numeric implementation.

Changed parmstyle of asyncpg dialect to use numeric, rendering with its native
$ identifiers

Fixes: #8926
Fixes: #8849
Change-Id: I7c640467d49adfe6d795cc84296fc7403dcad4d6

2 years agoType annotations for sqlalchemy.ext.automap
Gleb Kisenkov [Mon, 5 Dec 2022 13:45:25 +0000 (08:45 -0500)] 
Type annotations for sqlalchemy.ext.automap

An attempt to annotate `lib/sqlalchemy/ext/automap.py` with type hints (issue [#6810](https://github.com/sqlalchemy/sqlalchemy/issues/6810#issuecomment-1127062951)).

More info on how I approach it could be found in [the earlier PR](https://github.com/sqlalchemy/sqlalchemy/pull/8775).

This pull request is:

- [ ] A documentation / typographical error fix
  - Good to go, no issue or tests are needed
- [ ] 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.
- [x] 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: #8874
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8874
Pull-request-sha: 834d58d77c2cfd09ea874f01eb7b75a2ea0db7cd

Change-Id: Ie64b2be7a51ddc83ef8f23385fb63db5b5c1bc17

2 years agoMerge "adjustments for unreliable gc" into main
mike bayer [Mon, 5 Dec 2022 14:01:12 +0000 (14:01 +0000)] 
Merge "adjustments for unreliable gc" into main

2 years agoMerge "Fixed an invalid syntax in an except statement" into main
mike bayer [Mon, 5 Dec 2022 13:54:51 +0000 (13:54 +0000)] 
Merge "Fixed an invalid syntax in an except statement" into main

2 years agoMerge "Fix grammar (whatsnew_20.rst)" into main
mike bayer [Mon, 5 Dec 2022 13:54:37 +0000 (13:54 +0000)] 
Merge "Fix grammar (whatsnew_20.rst)" into main

2 years agoFixed an invalid syntax in an except statement
wiseaidev [Mon, 5 Dec 2022 13:44:35 +0000 (08:44 -0500)] 
Fixed an invalid syntax in an except statement

### Description

As the title suggests, I have fixed an invalid syntax in the docs for an `except` statement while reading the unusual.

### 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:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] 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: #8715
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8715
Pull-request-sha: e8be2bc4a5401ab2a5a0fc1d2e50d41fa437ae80

Change-Id: If8512bf1853f7cdb1ae655f0945cd922fff6fbce

2 years agodoc change - Add new external dialect for openGauss
j00356287 [Mon, 5 Dec 2022 13:44:09 +0000 (08:44 -0500)] 
doc change - Add new external dialect for openGauss

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->
Added new external dialect for [openGauss](https://www.opengauss.org/en/).

### 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:

- [x] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] 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: #8803
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8803
Pull-request-sha: ca5a7f1310b2ce93ce33618e0609abe23b41a3da

Change-Id: Ia8ca38f98f346fa3cc910ceb7af47f8c903eb587

2 years agoFix grammar (whatsnew_20.rst)
Sam Bull [Mon, 5 Dec 2022 13:43:50 +0000 (08:43 -0500)] 
Fix grammar (whatsnew_20.rst)

None

Closes: #8835
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/8835
Pull-request-sha: 7488c752d90ce305076ba06b7a4077dc67c0ea66

Change-Id: Iad959dcff21bd1aa593793c4a38cb795529468e8

2 years agoadjustments for unreliable gc
Mike Bayer [Mon, 5 Dec 2022 04:25:14 +0000 (23:25 -0500)] 
adjustments for unreliable gc

sporadic (and at the moment persistent) test failures
related to aiosqlite seem to have in common that Python
gc stops working fully when we run a lot of tests with
aiosqlite.  The failures are not limited to aiosqlite
as they are more involving places where we assume or
expect gc.collect() to get rid of things, and it doesn't.

Identify (based on reproducible case on the d3 CI runner)
the spots where this happens and add fixes.

test/orm/test_transaction.py test_gced_delete_on_rollback
has always been a very sensitive test with a lot of issues,
so here we move it to the test_memusage suite and limit
it only to when the memusage suite is running.

Change-Id: I683412d0effe8732c45980b40722e5bb63431177

2 years agoMerge "disallow same-named columns, unchecked replacement in Table" into main
mike bayer [Sun, 4 Dec 2022 17:25:44 +0000 (17:25 +0000)] 
Merge "disallow same-named columns, unchecked replacement in Table" into main

2 years agodisallow same-named columns, unchecked replacement in Table
Mike Bayer [Sat, 3 Dec 2022 14:11:14 +0000 (09:11 -0500)] 
disallow same-named columns, unchecked replacement in Table

Fixed issue where table reflection using :paramref:`.Table.extend_existing`
would fail to deduplicate a same-named column if the existing
:class:`.Table` used a separate key. The
:paramref:`.Table.autoload_replace` parameter would allow the column to be
skipped but under no circumstances should a :class:`.Table` ever have the
same-named column twice.

Additionally, changed deprecation warnings to exceptions
as were implemented in I1d58c8ebe081079cb669e7ead60886ffc1b1a7f5 .

Fixes: #8925
Change-Id: I83d0f8658177a7ffbb06e01dbca91377d1a98d49

2 years agoMerge "Order_by and group_by accept labels" into main
mike bayer [Sun, 4 Dec 2022 15:00:46 +0000 (15:00 +0000)] 
Merge "Order_by and group_by accept labels" into main

2 years agoSome test pipeline updates
Federico Caselli [Thu, 1 Dec 2022 21:29:50 +0000 (22:29 +0100)] 
Some test pipeline updates

Add back pypy, python 3.12

Change-Id: Ie3b3b890d75b3939b3d5f684ec7eadadfe06a5ea

2 years agoOrder_by and group_by accept labels
Federico Caselli [Sat, 3 Dec 2022 16:39:55 +0000 (17:39 +0100)] 
Order_by and group_by accept labels

Improve typing to accept labels in ordey_by mand group_by.

Change-Id: I33e5d6f64633d39a220108d412ef84d6478b25e6

2 years agoadd spaces, leading underscore to oracle checks
Mike Bayer [Fri, 2 Dec 2022 22:00:10 +0000 (17:00 -0500)] 
add spaces, leading underscore to oracle checks

Expand the test suite from #8708 which unfortunately did
not exercise the bound parameter codepaths completely.

Continued fixes for Oracle fix :ticket:`8708` released in 1.4.43 where
bound parameter names that start with underscores, which are disallowed by
Oracle, were still not being properly escaped in all circumstances.

Fixes: #8708
Change-Id: Ic389c09bd7c53b773e5de35f1a18ef20769b92a7