]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
4 years agoUpdate declarative_mixins.rst 5946/head
serzey [Tue, 16 Feb 2021 09:10:03 +0000 (10:10 +0100)] 
Update declarative_mixins.rst

Variables ta and tb should be instances of TypeA and TypeB respectively.

4 years agoVersion 1.4.0 placeholder
Mike Bayer [Mon, 15 Feb 2021 20:00:41 +0000 (15:00 -0500)] 
Version 1.4.0 placeholder

4 years ago- 1.4.0b3 rel_1_4_0b3
Mike Bayer [Mon, 15 Feb 2021 19:49:10 +0000 (14:49 -0500)] 
- 1.4.0b3

4 years agonext release is 1.4.0b3
Mike Bayer [Mon, 15 Feb 2021 19:48:33 +0000 (14:48 -0500)] 
next release is 1.4.0b3

Change-Id: I2c941b47c667e83fef9687da31fe20d59d2ea5c8

4 years agozzzeeksphinx 1.2.1 needed w/ sphinx 3.5.0
Mike Bayer [Mon, 15 Feb 2021 19:40:31 +0000 (14:40 -0500)] 
zzzeeksphinx 1.2.1 needed w/ sphinx 3.5.0

Change-Id: Ie81ac4dfaf53b2ff7df37603b473509f320726be

4 years agoMerge "Support legacy select(<iterable>) in addition to select(<list>) in v1.4"
mike bayer [Mon, 15 Feb 2021 19:33:05 +0000 (19:33 +0000)] 
Merge "Support legacy select(<iterable>) in addition to select(<list>) in v1.4"

4 years agoSupport legacy select(<iterable>) in addition to select(<list>) in v1.4
Oliver Rice [Sat, 13 Feb 2021 19:21:55 +0000 (14:21 -0500)] 
Support legacy select(<iterable>) in addition to select(<list>) in v1.4

Fixed regression where use of an arbitrary iterable with the
:func:`_sql.select` function was not working, outside of plain lists. The
forwards/backwards compatibility logic here now checks for a wider range of
incoming "iterable" types including that a ``.c`` collection from a
selectable can be passed directly. Pull request compliments of Oliver Rice.

Fixes: #5935
Closes: #5936
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5936
Pull-request-sha: 575ab3e7df30fc8da03752d102c8eeb6cb3a3e3d

Change-Id: Icd972f1078d9ea96c47a64133079f00d9b0a66f3

4 years agoAccept ColumnCollection in update_on_conflict(set_=
Gord Thompson [Sat, 13 Feb 2021 21:43:21 +0000 (14:43 -0700)] 
Accept ColumnCollection in update_on_conflict(set_=

Fixes: #5939
Change-Id: I21d7125765028e2a98d5ef4c32d8e7e457aa2d12

4 years agoMerge remote-tracking branch 'origin/pr/5943'
Mike Bayer [Mon, 15 Feb 2021 18:13:07 +0000 (13:13 -0500)] 
Merge remote-tracking branch 'origin/pr/5943'

Change-Id: I19161c700eab1c30103fea2971ca5574d3207b5c

4 years agofix repeated footnote
Mike Bayer [Mon, 15 Feb 2021 16:21:41 +0000 (11:21 -0500)] 
fix repeated footnote

Change-Id: Ibd8239907c3cf747d0d9a0fb670e37c9913871f8

4 years agoBumy Sphinx 5943/head
Sam Bull [Mon, 15 Feb 2021 10:36:30 +0000 (10:36 +0000)] 
Bumy Sphinx

4 years agoMerge "Allow update.returing() to work with from_statement()"
mike bayer [Sun, 14 Feb 2021 21:54:59 +0000 (21:54 +0000)] 
Merge "Allow update.returing() to work with from_statement()"

4 years agoAllow update.returing() to work with from_statement()
Mike Bayer [Sun, 14 Feb 2021 04:21:04 +0000 (23:21 -0500)] 
Allow update.returing() to work with from_statement()

The ORM used in :term:`2.0 style` can now return ORM objects from the rows
returned by an UPDATE..RETURNING or INSERT..RETURNING statement, by
supplying the construct to :meth:`_sql.Select.from_statement` in an ORM
context.

Change-Id: I59c9754ff1cb3184580dd5194ecd2971d4e7f8e8
References: #5940

4 years agoAdd emphasis to URL documentation re: URL encoding
Mike Bayer [Sun, 14 Feb 2021 19:36:27 +0000 (14:36 -0500)] 
Add emphasis to URL documentation re: URL encoding

Fixes: #5715
Change-Id: I2ac16541d34f49b25070e00c43596bcd71aff72d

4 years agofix typos
Mike Bayer [Sun, 14 Feb 2021 17:13:56 +0000 (12:13 -0500)] 
fix typos

Change-Id: Ifb9e75e5af9412224b1e75491c497ba67e2018d4

4 years agoexpand and further generalize bound parameter translate
Mike Bayer [Sat, 13 Feb 2021 22:13:51 +0000 (17:13 -0500)] 
expand and further generalize bound parameter translate

Continued with the improvement made as part of :ticket:`5653` to further
support bound parameter names, including those generated against column
names, for names that include colons, parenthesis, and question marks, as
well as improved test support, so that bound parameter names even if they
are auto-derived from column names should have no problem including for
parenthesis in psycopg2's "pyformat" style.

As part of this change, the format used by the asyncpg DBAPI adapter (which
is local to SQLAlchemy's asyncpg diaelct) has been changed from using
"qmark" paramstyle to "format", as there is a standard and internally
supported SQL string escaping style for names that use percent signs with
"format" style (i.e. to double percent signs), as opposed to names that use
question marks with "qmark" style (where an escaping system is not defined
by pep-249 or Python).

Fixes: #5941
Change-Id: Id86f5af81903d7063a8e3505e60df56490f85358

4 years ago[doc/build/changelog/migration_20.rst] Remove and 5937/head
Samuel Marks [Sat, 13 Feb 2021 12:15:39 +0000 (23:15 +1100)] 
[doc/build/changelog/migration_20.rst] Remove and

4 years agoFurther refine labeling for renamed columns
Mike Bayer [Thu, 11 Feb 2021 19:05:49 +0000 (14:05 -0500)] 
Further refine labeling for renamed columns

Forked from I22f6cf0f0b3360e55299cdcb2452cead2b2458ea
we are attempting to decide the case for columns mapped
under a different name.   since the .key feature of
Column seems to support this fully, see if an annotation
can be used to indicate an effective .key for a column.

The effective change is that the labeling of column expressions
in rows has been improved to retain the original name of the ORM
attribute even if used in a subquery.

References: #5933
Change-Id: If251f556f7d723f50d349f765f1690d6c679d2ef

4 years agoMerge "Apply consistent labeling for all future style ORM queries"
mike bayer [Fri, 12 Feb 2021 17:10:21 +0000 (17:10 +0000)] 
Merge "Apply consistent labeling for all future style ORM queries"

4 years agoMerge "test Function(?:Element)._bind_param() with in_()"
mike bayer [Thu, 11 Feb 2021 23:29:39 +0000 (23:29 +0000)] 
Merge "test Function(?:Element)._bind_param() with in_()"

4 years agoPrepare to ship 1.4.0b3
Mike Bayer [Thu, 11 Feb 2021 23:27:56 +0000 (18:27 -0500)] 
Prepare to ship 1.4.0b3

Due to #5933 and to a lesser degree #5934,
put out 1.4.0b3 so that it gets some coverage before release.

Change-Id: Ic5538e2f64e811b34d7c3dc03307073a55a63a87

4 years agoApply consistent labeling for all future style ORM queries
Mike Bayer [Thu, 11 Feb 2021 19:05:49 +0000 (14:05 -0500)] 
Apply consistent labeling for all future style ORM queries

Fixed issue in new 1.4/2.0 style ORM queries where a statement-level label
style would not be preserved in the keys used by result rows; this has been
applied to all combinations of Core/ORM columns / session vs. connection
etc. so that the linkage from statement to result row is the same in all
cases.

also repairs a cache key bug where query.from_statement()
vs. select().from_statement() would not be disambiguated; the
compile options were not included in the cache key for
FromStatement.

Fixes: #5933
Change-Id: I22f6cf0f0b3360e55299cdcb2452cead2b2458ea

4 years agotest Function(?:Element)._bind_param() with in_()
Mike Bayer [Thu, 11 Feb 2021 22:51:15 +0000 (17:51 -0500)] 
test Function(?:Element)._bind_param() with in_()

Fixed 1.4 regression where the :meth:`_functions.Function.in_` method was
not covered by tests and failed to function properly in all cases.

Fixes: #5934
Change-Id: I93423a296e391aabd5594cb670d36b91ced0231d

4 years agoDon't pre-calc inserted primary key if no getter
Mike Bayer [Wed, 10 Feb 2021 15:36:52 +0000 (10:36 -0500)] 
Don't pre-calc inserted primary key if no getter

the _setup_ins_pk_from_empty() method provides a placeholder
result for inserted_primary_key_rows that is not typically
going to be invoked.  For an executemany (or even execute)
that isn't already stating it wants primary key values
up front, defer this computation until explicitly requested.

Change-Id: I6295eafbccc96a0422b9cac34e79db7924c702ca
References: https://github.com/sqlalchemy/sqlalchemy/discussions/5893#discussioncomment-356155

4 years agoturn section into a bulleted list
Mike Bayer [Wed, 10 Feb 2021 15:13:45 +0000 (10:13 -0500)] 
turn section into a bulleted list

Change-Id: I18f047a999bd48d6d0e3c495a0ca675b042c1bb6
(cherry picked from commit 95916d658c9c0a812f3ed33830260a0924439035)

4 years agoMerge "Detect non async driver on engine creation"
mike bayer [Tue, 9 Feb 2021 20:29:57 +0000 (20:29 +0000)] 
Merge "Detect non async driver on engine creation"

4 years agoupdate the intro to accommodate for the 1.4/2.0 overview
Mike Bayer [Tue, 9 Feb 2021 19:23:11 +0000 (14:23 -0500)] 
update the intro to accommodate for the 1.4/2.0 overview

Change-Id: Ida77a4d89a2cb8a67a4608831f66a5ab533e0472

4 years agoMerge "Add identifier_preparer per-execution context for schema translates"
mike bayer [Mon, 8 Feb 2021 22:56:25 +0000 (22:56 +0000)] 
Merge "Add identifier_preparer per-execution context for schema translates"

4 years agoMerge "Use slots in the aiomysql proxy classes"
mike bayer [Mon, 8 Feb 2021 18:41:20 +0000 (18:41 +0000)] 
Merge "Use slots in the aiomysql proxy classes"

4 years agoAdd identifier_preparer per-execution context for schema translates
Mike Bayer [Mon, 8 Feb 2021 16:58:15 +0000 (11:58 -0500)] 
Add identifier_preparer per-execution context for schema translates

Fixed bug where the "schema_translate_map" feature failed to be taken into
account for the use case of direct execution of
:class:`_schema.DefaultGenerator` objects such as sequences, which included
the case where they were "pre-executed" in order to generate primary key
values when implicit_returning was disabled.

Fixes: #5929
Change-Id: I3fed1d0af28be5ce9c9bb572524dcc8411633f60

4 years agoMerge branch 'master' of ssh://gerrit.sqlalchemy.org:29418/sqlalchemy/sqlalchemy
Mike Bayer [Sun, 7 Feb 2021 14:57:38 +0000 (09:57 -0500)] 
Merge branch 'master' of ssh://gerrit.sqlalchemy.org:29418/sqlalchemy/sqlalchemy

Change-Id: Idc5c09e2953c998aa5b9a49715e23026bba2e851

4 years agoDocument implicit IO points in ORM
Mike Bayer [Sun, 7 Feb 2021 14:51:48 +0000 (09:51 -0500)] 
Document implicit IO points in ORM

I purposely didn't spend much documentation writing
about implicit IO when I first pushed out the asyncio
extension because I wanted to get a sense on what kinds
of issues people had.   Now we know and the answer is
predictably "all of them".  List out all the known
implicit IO points and how to avoid them.  Also rename
the "adapting lazy loads" section, so that the title is less
suggestive that this is a necessary technique.

References: #5926

Change-Id: I3933b74bd37a5b06989531adbeade34347db679b

4 years agoUse slots in the aiomysql proxy classes
Federico Caselli [Sat, 6 Feb 2021 16:54:42 +0000 (17:54 +0100)] 
Use slots in the aiomysql proxy classes

Add slots in the proxy cursor and connection classes in the aiomysql dialect

Change-Id: If72fccf0cc16557a7e3a0c9450733c8337bec15a

4 years agoDetect non async driver on engine creation
Federico Caselli [Sat, 6 Feb 2021 11:11:54 +0000 (12:11 +0100)] 
Detect non async driver on engine creation

An error is raised when creating an async engine with an
incompatible dbapi. Before the error was raised only when
first using the engine.

Change-Id: I977952b4c03ae51f568749ad744c545197bcd887
Reference: #5920

4 years agoTrack a second from_linter for lateral subqueries
Mike Bayer [Fri, 5 Feb 2021 18:38:28 +0000 (13:38 -0500)] 
Track a second from_linter for lateral subqueries

Fixed bug where the "cartesian product" assertion was not correctly
accommodating for joins between tables that relied upon the use of LATERAL
to connect from a subquery to another subquery in the enclosing context.

Additionally, enabled from_linting for the base assert_compile(),
however it remains off by default; to enable by default we would
have to make sure it isn't set for DDL compiles and there's also
a lot of tests that would also need to turn it off, so leaving
this off for expediency.

Fixes: #5924
Change-Id: I22604baf572f8c4d96befcc610b3dcb79c13fc4a

4 years agoMerge remote-tracking branch 'origin/pr/5883'
Mike Bayer [Fri, 5 Feb 2021 14:24:38 +0000 (09:24 -0500)] 
Merge remote-tracking branch 'origin/pr/5883'

Change-Id: I221871acc0569df58b1665b2a90b440e102a9c55

4 years agoAccommodate column-based naming conventions for pk constraint
Mike Bayer [Thu, 4 Feb 2021 17:09:54 +0000 (12:09 -0500)] 
Accommodate column-based naming conventions for pk constraint

Repaired / implemented support for primary key constraint naming
conventions that use column names/keys/etc as part of the convention. In
particular, this includes that the :class:`.PrimaryKeyConstraint` object
that's automatically associated with a :class:`.schema.Table` will update
its name as new primary key :class:`_schema.Column` objects are added to
the table and then to the constraint. Internal failure modes related to
this constraint construction process including no columns present, no name
present or blank name present are now accommodated.

Fixes: #5919
Change-Id: Ic2800b50f4a4cd5978bec48cefea0a2e198e0123

4 years agoorm/session.py - comment grammar fix 5917/head
Maciej Brencz [Thu, 4 Feb 2021 09:44:34 +0000 (10:44 +0100)] 
orm/session.py - comment grammar fix

4 years agoVersion 1.4.0 placeholder
Mike Bayer [Wed, 3 Feb 2021 23:30:26 +0000 (18:30 -0500)] 
Version 1.4.0 placeholder

4 years ago- 1.4.0b2 rel_1_4_0b2
Mike Bayer [Wed, 3 Feb 2021 23:15:11 +0000 (18:15 -0500)] 
- 1.4.0b2

4 years agoadd asyncio as a changelog section
Mike Bayer [Wed, 3 Feb 2021 23:04:07 +0000 (18:04 -0500)] 
add asyncio as a changelog section

Change-Id: I84eabb0f96ed857927dcbd368568ec51c155c0f8
(cherry picked from commit d003904086db442fce87165500054b37c887b385)

4 years agoMerge "un-deprecate Oracle 2pc"
mike bayer [Wed, 3 Feb 2021 21:58:08 +0000 (21:58 +0000)] 
Merge "un-deprecate Oracle 2pc"

4 years agofix gc related race in weakdict popitem
Mike Bayer [Wed, 3 Feb 2021 21:56:58 +0000 (16:56 -0500)] 
fix gc related race in weakdict popitem

Change-Id: I88c19b6d3c97a714f7e4bf22812a23e095f9dcba

4 years agoRepair tests for older SQLite, timing, pypy
Mike Bayer [Wed, 3 Feb 2021 21:47:53 +0000 (16:47 -0500)] 
Repair tests for older SQLite, timing, pypy

Change-Id: I9e425d2415d18a893342244755c7748b546fb20d

4 years agoMerge "Improve noload documentation"
mike bayer [Wed, 3 Feb 2021 21:30:51 +0000 (21:30 +0000)] 
Merge "Improve noload documentation"

4 years agoMerge "Implement support for functions as FROM with columns clause support"
mike bayer [Wed, 3 Feb 2021 21:26:19 +0000 (21:26 +0000)] 
Merge "Implement support for functions as FROM with columns clause support"

4 years agoun-deprecate Oracle 2pc
Mike Bayer [Wed, 27 Jan 2021 20:29:29 +0000 (15:29 -0500)] 
un-deprecate Oracle 2pc

Oracle two-phase transactions at a rudimentary level are now no longer
deprecated. After receiving support from cx_Oracle devs we can provide for
basic xid + begin/prepare support with some limitations, which will work
more fully in an upcoming release of cx_Oracle. Two phase "recovery" is not
currently supported.

Fixes: #5884
Change-Id: I961c0ad14a530acc6b069bd9bfce99fc34124abc

4 years agoImplement support for functions as FROM with columns clause support
Mike Bayer [Sun, 17 Jan 2021 18:35:02 +0000 (13:35 -0500)] 
Implement support for functions as FROM with columns clause support

Implemented support for "table valued functions" along with additional
syntaxes supported by PostgreSQL, one of the most commonly requested
features. Table valued functions are SQL functions that return lists of
values or rows, and are prevalent in PostgreSQL in the area of JSON
functions, where the "table value" is commonly referred towards as the
"record" datatype. Table valued functions are also supported by Oracle and
SQL Server.

Moved from I5b093b72533ef695293e737eb75850b9713e5e03 due
to accidental push

Fixes: #3566
Change-Id: Iea36d04c80a5ed3509dcdd9ebf0701687143fef5

4 years agoMerge "Implement per-connection logging token"
mike bayer [Wed, 3 Feb 2021 20:00:51 +0000 (20:00 +0000)] 
Merge "Implement per-connection logging token"

4 years agoImplement per-connection logging token
Mike Bayer [Wed, 3 Feb 2021 16:53:18 +0000 (11:53 -0500)] 
Implement per-connection logging token

Added new execution option
:paramref:`_engine.Connection.execution_options.logging_token`. This option
will add an additional per-message token to log messages generated by the
:class:`_engine.Connection` as it executes statements. This token is not
part of the logger name itself (that part can be affected using the
existing :paramref:`_sa.create_engine.logging_name` parameter), so is
appropriate for ad-hoc connection use without the side effect of creating
many new loggers. The option can be set at the level of
:class:`_engine.Connection` or :class:`_engine.Engine`.

Fixes: #5911
Change-Id: Iec9c39b868b3578fcedc1c094dace5b6f64bacea

4 years agoAdd coercions to literal()
Mike Bayer [Wed, 3 Feb 2021 15:42:08 +0000 (10:42 -0500)] 
Add coercions to literal()

To prevent literal() from receiving a ClauseElement which
then leads to confusing results, add a new LiteralValueRole
coercion that does an _is_literal() check and implement
for literal().

Fixes: #5639
Change-Id: Ibd686544af2d7c013765278f984baf237de88caf

4 years agoImprove noload documentation
Federico Caselli [Tue, 2 Feb 2021 19:49:41 +0000 (20:49 +0100)] 
Improve noload documentation

Also add a link to the loading strategies doc from the
async orm docs

Fixes: #5832
Change-Id: I41170369273df7d323f7140cd05759567484dc4d

4 years agodon't fail if purge recyclebin fails/mutex on registry
Mike Bayer [Tue, 2 Feb 2021 16:26:55 +0000 (11:26 -0500)] 
don't fail if purge recyclebin fails/mutex on registry

the recyclebin purge is failing after SetInputSizesTest
on occasion.  try to reduce transaction overhead and don't
error out if the purge fails.

ensure _CONFIGURE_MUTEX is used when mutating or
iterating the _mapper_registries collection.

Change-Id: I9d9cd53b92419a2ad97bae5ee8bdd2657b6e408f

4 years agoMerge "reorganize mapper compile/teardown under registry"
mike bayer [Mon, 1 Feb 2021 23:13:42 +0000 (23:13 +0000)] 
Merge "reorganize mapper compile/teardown under registry"

4 years agoreorganize mapper compile/teardown under registry
Mike Bayer [Sat, 30 Jan 2021 16:55:22 +0000 (11:55 -0500)] 
reorganize mapper compile/teardown under registry

Mapper "configuration", which occurs within the
:func:`_orm.configure_mappers` function, is now organized to be on a
per-registry basis. This allows for example the mappers within a certain
declarative base to be configured, but not those of another base that is
also present in memory. The goal is to provide a means of reducing
application startup time by only running the "configure" process for sets
of mappers that are needed. This also adds the
:meth:`_orm.registry.configure` method that will run configure for the
mappers local in a particular registry only.

Fixes: #5897
Change-Id: I14bd96982d6d46e241bd6baa2cf97471d21e7caa

4 years agocherry-pick changelog update for 1.3.24
Mike Bayer [Mon, 1 Feb 2021 20:56:44 +0000 (15:56 -0500)] 
cherry-pick changelog update for 1.3.24

4 years agocherry-pick changelog from 1.3.23
Mike Bayer [Mon, 1 Feb 2021 20:56:44 +0000 (15:56 -0500)] 
cherry-pick changelog from 1.3.23

4 years agoset identifier length for MySQL constraints to 64
Mike Bayer [Sat, 30 Jan 2021 21:57:50 +0000 (16:57 -0500)] 
set identifier length for MySQL constraints to 64

The rule to limit index names to 64 also applies to all
DDL names, such as those coming from naming conventions.
Add another limiting variable for constraint names and
create test cases against all constraint types.

Additionally, codified in the test suite MySQL's lack of
support for naming of a FOREIGN KEY constraint after
the name was given, which apparently assigns the name to an
associated KEY but not the constraint itself, until MySQL 8
and MariaDB 10.5 which appear to have resolved the
behavior.  However it's not clear how Alembic hasn't had
issues reported with this so far.

Fixed long-lived bug in MySQL dialect where the maximum identifier length
of 255 was too long for names of all types of constraints, not just
indexes, all of which have a size limit of 64. As metadata naming
conventions can create too-long names in this area, apply the limit to the
identifier generator within the DDL compiler.

Fixes: #5898
Change-Id: I79549474845dc29922275cf13321c07598dcea08

4 years agoMerge "Use schema._copy_expression() fully in column collection constraints"
mike bayer [Fri, 29 Jan 2021 23:22:01 +0000 (23:22 +0000)] 
Merge "Use schema._copy_expression() fully in column collection constraints"

4 years agoUse schema._copy_expression() fully in column collection constraints
Gord Thompson [Mon, 25 Jan 2021 18:24:25 +0000 (11:24 -0700)] 
Use schema._copy_expression() fully in column collection constraints

Fixed issue where using :meth:`_schema.Table.to_metadata` (called
:meth:`_schema.Table.tometadata` in 1.3) in conjunction with a PostgreSQL
:class:`_postgresql.ExcludeConstraint` that made use of ad-hoc column
expressions would fail to copy correctly.

Fixes: #5850
Change-Id: I062480afb23f6f60962b7b55bc93f5e4e6ff05e4

4 years agoClarify Column.index / Column.unique parameters
Mike Bayer [Fri, 29 Jan 2021 18:43:38 +0000 (13:43 -0500)] 
Clarify Column.index / Column.unique parameters

These parameters need to be more clear that they cause a
constraint / index object to be generated.  Clarify the rules
by which this occurs and include contextual information about
naming conventions as well.

Change-Id: I8dc96ead4457215abed391fd1b9f732a1eef6e09
References: #5887

4 years agoMerge "Render NULL for bindparam w/ None value/literal_binds, warn"
mike bayer [Thu, 28 Jan 2021 22:19:10 +0000 (22:19 +0000)] 
Merge "Render NULL for bindparam w/ None value/literal_binds, warn"

4 years agoRender NULL for bindparam w/ None value/literal_binds, warn
Mike Bayer [Thu, 28 Jan 2021 19:53:02 +0000 (14:53 -0500)] 
Render NULL for bindparam w/ None value/literal_binds, warn

Adjusted the "literal_binds" feature of :class:`_sql.Compiler` to render
NULL for a bound parameter that has ``None`` as the value, either
explicitly passed or omitted. The previous error message "bind parameter
without a renderable value" is removed, and a missing or ``None`` value
will now render NULL in all cases. Previously, rendering of NULL was
starting to happen for DML statements due to internal refactorings, but was
not explicitly part of test coverage, which it now is.

While no error is raised, when the context is within that of a column
comparison, and the operator is not "IS"/"IS NOT", a warning is emitted
that this is not generally useful from a SQL perspective.

Fixes: #5888
Change-Id: Id5939d8dbfb1156a9f8a7f7e76cf18327155331a

4 years agoAllow Oracle CLOB/NCLOB/BLOB in returning
Mike Bayer [Thu, 28 Jan 2021 16:04:29 +0000 (11:04 -0500)] 
Allow Oracle CLOB/NCLOB/BLOB in returning

Fixed bug in Oracle dialect where retriving a CLOB/BLOB column via
:meth:`_dml.Insert.returning` would fail as the LOB value would need to be
read when returned; additionally, repaired support for retrieval of Unicode
values via RETURNING under Python 2.

As of yet, we still don't know how to reproduce the
ORA-24813 error indicated in the issue.

Fixes: #5812
Change-Id: I666f893e762dfa4d34dd2e324480565b226fb3a4

4 years agoRepair incorrect symbol PyDict_GetItemWithError for Python 2
Mike Bayer [Wed, 27 Jan 2021 17:57:47 +0000 (12:57 -0500)] 
Repair incorrect symbol PyDict_GetItemWithError for Python 2

* ensure on python 2 correct cflags to fail on undefined
symbols take effect

* fail for implicit function declaration

* python 2 does not publish PyDict_GetItemWithError but has
it as _PyDict_GetItemWIthError but only as of Python 2.7.12

Change-Id: I007509afddf7f44ca64e52fa9140be39f815fa7a

4 years agoFix broken link to cx_Oracle documentation 5883/head
Paul Lettich [Wed, 27 Jan 2021 13:31:39 +0000 (14:31 +0100)] 
Fix broken link to cx_Oracle documentation

4 years agoMerge "Fix many spell glitches in docstrings and comments"
mike bayer [Tue, 26 Jan 2021 23:12:33 +0000 (23:12 +0000)] 
Merge "Fix many spell glitches in docstrings and comments"

4 years agoMerge "Improve c implementation of immutabledict"
mike bayer [Tue, 26 Jan 2021 23:07:40 +0000 (23:07 +0000)] 
Merge "Improve c implementation of immutabledict"

4 years agoMerge "Replace with_labels() and apply_labels() in ORM/Core"
mike bayer [Tue, 26 Jan 2021 22:31:21 +0000 (22:31 +0000)] 
Merge "Replace with_labels() and apply_labels() in ORM/Core"

4 years agoAdd dbapimaster builds to tox.ini
Mike Bayer [Tue, 26 Jan 2021 22:21:06 +0000 (17:21 -0500)] 
Add dbapimaster builds to tox.ini

For the Jenkins dbapi-master build, we can no longer
put git URLs in a constraints file, so just use tox.ini
itself to provide alternate dependencies.

Change-Id: Id6b53c511954ec31371810da85eea7b5a58dbc0d

4 years agoadd sqlalchemy to FUNDING
Mike Bayer [Tue, 26 Jan 2021 21:53:34 +0000 (16:53 -0500)] 
add sqlalchemy to FUNDING

Change-Id: I764189f0360b97948c6222a3ff422d7259a55ef2

4 years agoReplace with_labels() and apply_labels() in ORM/Core
Gord Thompson [Sat, 9 Jan 2021 21:56:38 +0000 (14:56 -0700)] 
Replace with_labels() and apply_labels() in ORM/Core

Replace :meth:`_orm.Query.with_labels` and
:meth:`_sql.GenerativeSelect.apply_labels` with explicit getters and
setters ``get_label_style`` and ``set_label_style`` to accommodate the
three supported label styles: ``LABEL_STYLE_DISAMBIGUATE_ONLY`` (default),
``LABEL_STYLE_TABLENAME_PLUS_COL``, and ``LABEL_STYLE_NONE``.

In addition, for Core and "future style" ORM queries,
``LABEL_STYLE_DISAMBIGUATE_ONLY`` is now the default label style. This
style differs from the existing "no labels" style in that labeling is
applied in the case of column name conflicts; with ``LABEL_STYLE_NONE``, a
duplicate column name is not accessible via name in any case.

For legacy ORM queries using :class:`_query.Query`, the table-plus-column
names labeling style applied by ``LABEL_STYLE_TABLENAME_PLUS_COL``
continues to be used so that existing test suites and logging facilities
see no change in behavior by default, however this style of labeling is no
longer required for SQLAlchemy queries to function, as result sets are
commonly matched to columns using a positional approach since SQLAlchemy
1.0.

Within test suites, all use of apply_labels()  / use_labels
now uses the new methods.    New tests added to
test/sql/test_deprecations.py nad test/orm/test_deprecations.py
to cover just the old apply_labels() method call.  Tests
in ORM that made explicit use apply_labels()/ etc. where it isn't needed
for the ORM to work correctly use default label style now.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #4757
Change-Id: I5fdcd2ed4ae8c7fe62f8be2b6d0e8f66409b6a54

4 years agoFill-out dataclass-related attr resolution
Mike Bayer [Mon, 25 Jan 2021 22:59:35 +0000 (17:59 -0500)] 
Fill-out dataclass-related attr resolution

Fixed issue where mixin attribute rules were not taking
effect correctly for attributes pulled from dataclasses
using the approach added in #5745.

Fixes: #5876
Change-Id: I45099a42de1d9611791e72250fe0edc69bed684c

4 years agoImprove c implementation of immutabledict
Federico Caselli [Mon, 25 Jan 2021 20:39:42 +0000 (21:39 +0100)] 
Improve c implementation of immutabledict

Avoids using the call methods and instead uses the dict c interface.

Fixes: #5871
Change-Id: I7a1211104da319b0793a149f1a24f9f95c9f6630

4 years agoAdd more docs on engine connecting w/ URL parameters
Mike Bayer [Mon, 25 Jan 2021 18:22:34 +0000 (13:22 -0500)] 
Add more docs on engine connecting w/ URL parameters

We have a special section for connect_args but didn't appropriately
introduce that URL keywords may be used as well, which otherwise
does not seem to be documented in a generalized way.  Add
this additional detail and contrast between URL query string
and connect_args including providing some transparency for
how to see what URL query string parameters will do for a given
dialect, as we do not handle these parameters consistently
right now.

Change-Id: I2227554732e307d4b525a9931e8d03ccc2c16726
References: #5874

4 years agoMerge "Limit AsyncAdaptedQueue to Python 3.7"
mike bayer [Sun, 24 Jan 2021 23:39:48 +0000 (23:39 +0000)] 
Merge "Limit AsyncAdaptedQueue to Python 3.7"

4 years agoMerge "Remove errant assertion from unit of work"
mike bayer [Sun, 24 Jan 2021 23:38:35 +0000 (23:38 +0000)] 
Merge "Remove errant assertion from unit of work"

4 years agoun-ignore mike's favorite testing filenames
Mike Bayer [Sun, 24 Jan 2021 22:26:36 +0000 (17:26 -0500)] 
un-ignore mike's favorite testing filenames

As im using vscode I'd like these filenames to show up
in filesearch but I'd like to keep "ignore .gitignore files"
turned on.   I've moved these names to my own local
.git/info/exclude instead.

Change-Id: Iee6192d42d0630bf1b26cb9c1d3c2f8acab6caf4

4 years agoRemove errant assertion from unit of work
Mike Bayer [Sat, 23 Jan 2021 23:02:17 +0000 (18:02 -0500)] 
Remove errant assertion from unit of work

Fixed ORM unit of work regression where an errant "assert primary_key"
statement interferes with primary key generation sequences that don't
actually consider the columns in the table to use a real primary key
constraint, instead using :paramref:`_orm.mapper.primary_key` to establish
certain columns as "primary".

Also remove errant "identity" requirement which does not seem to
represent any current backend and is applied to
test/sql/test_defaults.py->AutoIncrementTest, but these tests work
on all backends.

Fixes: #5867
Change-Id: I4502ca5079d824d7b4d055194947aa1a00effde7

4 years agoLimit AsyncAdaptedQueue to Python 3.7
Federico Caselli [Sun, 24 Jan 2021 19:49:06 +0000 (14:49 -0500)] 
Limit AsyncAdaptedQueue to Python 3.7

Tests here are failing for python 3.6 due to the lack
of asyncio.run().   It seems to be non-trivial to vendor
a working version of this in Python 3.6 as the tests here
are running it in alternate threads.

The python documentation imports everything directly from the
asyncio package, and it seems that py < 3.8 does not have the
asyncio.exception module

Closes: #5865
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5865
Pull-request-sha: 35cc1fa3f6ff962676f571ae30851f4b4d96762a

Change-Id: I9398c9fb2aa87f3228ce2f59277de732091bd541

4 years agoFix many spell glitches in docstrings and comments
Lele Gaifax [Sun, 24 Jan 2021 18:59:03 +0000 (13:59 -0500)] 
Fix many spell glitches in docstrings and comments

These were revealed by running `pylint --disable all --enable spelling --spelling-dict en_US` over all sources.

Closes: #5868
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5868
Pull-request-sha: bb249195d92e3b806e81ecf1192d5a1b3cd5db48

Change-Id: I96080ec93a9fbd20ce21e9e16265b3c77f22bb14

4 years agoMerge "include negation symbol in numeric default match"
mike bayer [Sat, 23 Jan 2021 18:07:41 +0000 (18:07 +0000)] 
Merge "include negation symbol in numeric default match"

4 years agoMerge "remove __allowlist__"
mike bayer [Sat, 23 Jan 2021 18:05:24 +0000 (18:05 +0000)] 
Merge "remove __allowlist__"

4 years agoMerge "Improve error message when await_ call errors"
mike bayer [Sat, 23 Jan 2021 15:33:50 +0000 (15:33 +0000)] 
Merge "Improve error message when await_ call errors"

4 years agoremove __allowlist__
Mike Bayer [Sat, 23 Jan 2021 15:31:20 +0000 (10:31 -0500)] 
remove __allowlist__

this testing element is not used

Change-Id: I484c9a9f070122545fcdabe5a7f13b0bfca17023

4 years agoMerge "Removed some legacy terms in favor of modern equivalents. (D&I)"
mike bayer [Sat, 23 Jan 2021 15:27:52 +0000 (15:27 +0000)] 
Merge "Removed some legacy terms in favor of modern equivalents. (D&I)"

4 years agoinclude negation symbol in numeric default match
Mike Bayer [Sat, 23 Jan 2021 08:00:56 +0000 (03:00 -0500)] 
include negation symbol in numeric default match

Fixed bug where MySQL server default reflection would fail for numeric
values with a negation symbol present.

Fixes: #5860
Change-Id: I02cacdb4f9ec7d9113c27bf0d9214c4e14f4d4f9

4 years agoFix a couple of bugs in the asyncio implementation
Federico Caselli [Sat, 9 Jan 2021 12:25:55 +0000 (13:25 +0100)] 
Fix a couple of bugs in the asyncio implementation

Log an informative message if a connection is not closed
and the gc is reclaiming it when using an async dpapi, that
does not support running IO at that stage.

The ``AsyncAdaptedQueue`` used by default on async dpapis
should instantiate a queue only when it's first used
to avoid binding it to a possibly wrong event loop.

Fixes: #5823
Change-Id: Ibfc50e209b1937ae3d6599ae7997f028c7a92c33

4 years agoImprove error message when await_ call errors
Federico Caselli [Tue, 12 Jan 2021 21:00:59 +0000 (22:00 +0100)] 
Improve error message when await_ call errors

Fixes: #5832
Change-Id: Ia2ed8f1d1ec54e5f6e1a8f817a69446fdb3b7f6d

4 years agoRemoved some legacy terms in favor of modern equivalents. (D&I)
jonathan vanasco [Thu, 21 Jan 2021 17:25:04 +0000 (12:25 -0500)] 
Removed some legacy terms in favor of modern equivalents. (D&I)

Migrated testing fixture:
`TestBase.__whitelist__` -> `TestBase.__allowlist__`

Migrated tox commands from deprecated to current:
`whitelist_externals` > `allowlist_externals`

Migrated test_session:
`blacklist` -> `blocklist`

Change-Id: I395d5ee977ff22fa703276b9b873cc96c59b9a35

4 years agoRevert "Implement support for functions as FROM with columns clause support"
Mike Bayer [Thu, 21 Jan 2021 16:15:06 +0000 (11:15 -0500)] 
Revert "Implement support for functions as FROM with columns clause support"

This reverts commit 05a31f2708590161d4b3b4c7ff65196c99b4a22b.

Atom has this little button called "push" and just pushes to master,
I wasn't even *on* master.  oops

4 years agoImplement support for functions as FROM with columns clause support
Mike Bayer [Sun, 17 Jan 2021 18:35:02 +0000 (13:35 -0500)] 
Implement support for functions as FROM with columns clause support

WIP

Fixes: #3566
Change-Id: I5b093b72533ef695293e737eb75850b9713e5e03

4 years agoMerge "chain joins from SelectState context, not Select"
mike bayer [Wed, 20 Jan 2021 23:52:52 +0000 (23:52 +0000)] 
Merge "chain joins from SelectState context, not Select"

4 years agoAdd missing changelog file
Mike Bayer [Wed, 20 Jan 2021 22:08:35 +0000 (17:08 -0500)] 
Add missing changelog file

In 8860117c9655a4bdeafeba we forgot to add the changelog file.

Fixes: #5169
Change-Id: Ia7a106e9e49aacbfd788eaec46b7826e8e4e065a

4 years agochain joins from SelectState context, not Select
Mike Bayer [Wed, 20 Jan 2021 22:06:14 +0000 (17:06 -0500)] 
chain joins from SelectState context, not Select

Fixed issue in new :meth:`_sql.Select.join` method where chaining from the
current JOIN wasn't looking at the right state, causing an expression like
"FROM a JOIN b <onclause>, b JOIN c <onclause>" rather than
"FROM a JOIN b <onclause> JOIN c <onclause>".

Added :meth:`_sql.Select.outerjoin_from` method to complement
:meth:`_sql.Select.join_from`.

Fixes: #5858
Change-Id: I1346ebe0963bbd1e4bf868650e3ee1d6d3072f04

4 years agoMerge "Document Table/Column accessors"
mike bayer [Wed, 20 Jan 2021 14:26:19 +0000 (14:26 +0000)] 
Merge "Document Table/Column accessors"

4 years agoDocument Table/Column accessors
Mike Bayer [Tue, 19 Jan 2021 20:14:46 +0000 (15:14 -0500)] 
Document Table/Column accessors

As Sphinx will not allow us to add attributes to the
.rst file while maintaining order, these have to be added
as class-level attributes.

Inlcude notes that "index" and "unique" parameters, while
indicated by Column.index / Column.unique, do not actually
indicate if the column is part of an index.

Fixes: #5851
Change-Id: I18fbaf6c504c4b1005b4c51057f80397fb48b387

4 years agoMerge "Disallow non-native psycopg2 Unicode in Python 3; update docs"
mike bayer [Tue, 19 Jan 2021 19:49:45 +0000 (19:49 +0000)] 
Merge "Disallow non-native psycopg2 Unicode in Python 3; update docs"

4 years agoDisallow non-native psycopg2 Unicode in Python 3; update docs
Federico Caselli [Tue, 12 Jan 2021 21:14:38 +0000 (22:14 +0100)] 
Disallow non-native psycopg2 Unicode in Python 3; update docs

Fixed issue where the psycopg2 dialect would silently pass the
``use_native_unicode=False`` flag without actually having any effect under
Python 3, as the psycopg2 DBAPI uses Unicode unconditionally under Python
3.  This usage now raises an :class:`_exc.ArgumentError` when used under
Python 3. Added test support for Python 2.

Additionally, added documentation for client_encoding parameter
that may be passed to libpq directly via psycopg2.

Change-Id: I40ddf6382c157fa9399c21f0e01064197ea100f8

4 years agoMerge "More replacements of mapper to map_imperatively"
mike bayer [Mon, 18 Jan 2021 21:58:49 +0000 (21:58 +0000)] 
Merge "More replacements of mapper to map_imperatively"