]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
19 months agoFix lint error rel_1_3
Federico Caselli [Wed, 8 Nov 2023 20:49:06 +0000 (21:49 +0100)] 
Fix lint error

Change-Id: Ifb53e125fc9fd759938908710b2474656dbf1ef9
(cherry picked from commit 1da3f3455dc97ad095d7abd10add7f12efe6c1c7)

19 months agoremove . in sys.path
Mike Bayer [Wed, 8 Nov 2023 20:20:24 +0000 (15:20 -0500)] 
remove . in sys.path

this should not be needed and is causing problems in python
3.12 due to the presence of the "changelog" directory

2 years agopin sphinx-copybutton and change config
Mike Bayer [Thu, 9 Feb 2023 17:05:47 +0000 (12:05 -0500)] 
pin sphinx-copybutton and change config

sphinx-copybutton introduced a new feature
in 0.5.1 which includes a default configuration
that breaks the regexp prompt matching scheme.

set copybutton_exclude to not include ".gp" as that's the class
where we exactly look for the prompts we are matching.
While we're there, use this new feature to exclude our sql
styles, even though this is not strictly necessary in our case.

pin sphinx-copybutton at 0.5.1 to avoid future problems.

Change-Id: I8eaeab13995c032b9ee3afd1f08dae5929009d45
References: https://github.com/executablebooks/sphinx-copybutton/issues/185
(cherry picked from commit 13d3b2c291f49525bc38d082d1c2abe9e03bd3fe)
(cherry picked from commit faa20b16590c1a0b10817d3828cf479a906aebda)

2 years agoremove nonsensical note
Mike Bayer [Thu, 18 Aug 2022 15:29:25 +0000 (11:29 -0400)] 
remove nonsensical note

this note is not factually incorrect but it makes no sense
why this would be in the middle of the abstract concrete doc

Change-Id: Icd67d9d9a93ee72714bf85d8d5ca39c0af61f356
(cherry picked from commit acf14885833da238606e6a0df7c5ab256e477f2c)

2 years agoupdate quoted_name doc
Mike Bayer [Thu, 4 Aug 2022 13:26:47 +0000 (09:26 -0400)] 
update quoted_name doc

Fixes: #8339
Change-Id: If78bc9babfdc6a4dde4e65d72858ac7a402cbb4d
(cherry picked from commit dc5a1c482ee1a8faf15fd81db866e5f72c1c719f)

3 years agoremove insanely old note from 12 years ago
Mike Bayer [Mon, 23 May 2022 13:48:05 +0000 (09:48 -0400)] 
remove insanely old note from 12 years ago

Change-Id: Id0929b6bc062fc4766c9c69427524e3cd2da1030
(cherry picked from commit 853f726454cff2f34c010cbafacfec85f51f8eeb)
(cherry picked from commit 7256643fd8bab26d389c872102b76a6fdef2731f)

3 years agoupdate Numeric/Float docstrings
Mike Bayer [Thu, 14 Apr 2022 13:59:11 +0000 (09:59 -0400)] 
update Numeric/Float docstrings

These docs were very out of date re: cdecimal.   Additionally,
as pointed out in #5252, the Numeric documentation is misleading;
SQLAlchemy's Numeric hierarchy resembles more of the Oracle
approach where precision and scale solely determine the kind of
datatype being worked with.   Float is essentially Numeric with
different defaults.

Fixes: #5252
Change-Id: I661109fabf04ba7831c7ddafba15321dd445ea5d
(cherry picked from commit 3d300066e8b20a89e0b82bf09dd0c4016f5f8e51)
(cherry picked from commit 0c0bcd95ce843d8541ae952ec5262851d109ab0a)

3 years agofurther simplify pool-sharing doc
Mike Bayer [Fri, 11 Mar 2022 21:01:09 +0000 (16:01 -0500)] 
further simplify pool-sharing doc

1. the event based approach doesn't require dispose() to be
   called at all, and the note that the "pool will hang" makes
   no sense.   I have no idea what that refers towards
2. the subsequent paragraph about connections and sessions
   is unintelligible.  old paragraphs like these are likely
   why people complain about the docs so much.  try to just
   say "don't do this", as that is easier than trying to
   explain to use connection.invalidate() etc.

Change-Id: Id840c65a2f71583ced4dc82fd8690e7da4c4b10e
(cherry picked from commit b098d2a8b9c8a6fd1ddc5dce1eca7e70ace3f545)

3 years agodispose session outside of child proc
Mike Bayer [Fri, 11 Mar 2022 19:59:04 +0000 (14:59 -0500)] 
dispose session outside of child proc

disposing inside the child proc can interfere with the parent
process.  we likely never considered this.

Fixes: #7815
Change-Id: I6ad0e5840655ed99a9d30002eba280c8e44a5c2e
(cherry picked from commit 936f0b2fc226171a81df3ca66c269750e7e52436)

3 years agoadd copybutton
Mike Bayer [Fri, 11 Mar 2022 18:40:16 +0000 (13:40 -0500)] 
add copybutton

works great, including for plain code plus prompt code
with SQL (copies only the prompt code when prompts are present).
added some styling to zzzeeksphinx

Change-Id: I1b94b0488689e875adfb90ec171e04f7e8022415
(cherry picked from commit 7a48471f6482576ac50abab35ce4fa64c1f633b4)

3 years agoreplace "e.g.::" with more context regarding attribute events example
Mike Bayer [Tue, 25 Jan 2022 14:14:32 +0000 (09:14 -0500)] 
replace "e.g.::" with more context regarding attribute events example

Fixes: #7613
Change-Id: I28a9577587399c41afd53fbd026003667654c3fc
(cherry picked from commit 5e3357c70e419c244156ac3885b2cf784b5b3fc0)

3 years agoscoped_session adjustments
Mike Bayer [Tue, 30 Nov 2021 14:06:29 +0000 (09:06 -0500)] 
scoped_session adjustments

* fix typo, change to a note the async scoped session note
* more dragons re: threading.local()

Change-Id: I76266507510e4014456d992656f4aadf6d03ba4a
(cherry picked from commit 912bdcc8075c640a4f3d9e0194f57b5bdcfc6f2b)

3 years agopin pytest < 7
Mike Bayer [Mon, 29 Nov 2021 21:23:30 +0000 (16:23 -0500)] 
pin pytest < 7

pytest 7 support is implemented as of rel_1_4.
for previous versions, test collection won't work under
pytest 7.

Change-Id: I775a71e3941d4e19efb2d9ee7ec7591d6dd38fc5

3 years agosupport utf8mb3 char encoding fully for mysqlclient, others
Mike Bayer [Sat, 2 Oct 2021 15:53:55 +0000 (11:53 -0400)] 
support utf8mb3 char encoding fully for mysqlclient, others

Fixes to accommodate for the MariaDB 10.6 series, including backwards
incompatible changes in both the mariadb-connector Python driver as well
as the native 10.6 client libraries that are used automatically by the
mysqlclient DBAPI.  The "utf8mb3" encoding symbol is now reported by
these client libraries when the encoding is stated as "utf8", leading to
lookup and encoding errors within the MySQL dialect that does not expect
this symbol.   Updates to both the MySQL base library to accommodate for
this utf8mb3 symbol being reported as well as to the test suite.
Thanks to Georg Richter for support.

Fixes: #7136
Fixes: #7115
Change-Id: I655d9d9868aef76037023d0c602b8a7c881780b0
(cherry picked from commit f43e65f9b557b2d110141137a0216c661ba038b4)

3 years agoadd attribute sphinx is breaking on
Mike Bayer [Fri, 17 Sep 2021 21:27:46 +0000 (17:27 -0400)] 
add attribute sphinx is breaking on

the hybridmethod internal seems to be confusing
a recent version of sphinx autodoc, add attribute it's searching
for.

Change-Id: I27f671a51f857b62337cc2374bbc87383ae9710d
(cherry picked from commit c50183274728544e40e7da4fd35cf240da5df656)

3 years agoEncourage primary_key for secondary tables
Mike Bayer [Tue, 20 Jul 2021 13:17:17 +0000 (09:17 -0400)] 
Encourage primary_key for secondary tables

Change-Id: Ied56e52eaccf5d6dcb2729bdcf829f3ac4632f4c
(cherry picked from commit e72106d1499ec628487f7e428e7c49acdd4eb9c0)

4 years agoDocs: fixed typo in "Cascades"
Chris [Wed, 7 Jul 2021 01:12:00 +0000 (03:12 +0200)] 
Docs: fixed typo in "Cascades"

(cherry picked from commit 990069b2e8627b7c7c649d1198390ec728b43089)

4 years agoAdded netezza in external dialects in documentation
Abhishek Jog [Wed, 16 Jun 2021 19:15:24 +0000 (15:15 -0400)] 
Added netezza in external dialects in documentation

### Description
IBM Netezza Performance Server (aka Netezza, NPS) now has fully function SQLAlchemy dialect. Need to add it in SQLAlchemy 1.3 documentation.
This PR fixes https://github.com/sqlalchemy/sqlalchemy/issues/6609

### 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: #6610
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6610
Pull-request-sha: 2de51ff3887048e7df39e71b30b0e1824cfa0f56

Change-Id: I3a3f49981a4aaca0874bc2765cd782da61a258ef

4 years agoAdd note regarding encryption-related pragmas
Federico Caselli [Mon, 7 Jun 2021 19:14:05 +0000 (21:14 +0200)] 
Add note regarding encryption-related pragmas
passed in the url in pysqlcipher.

Fixes: #6589
Change-Id: I86f93f84ef2bd374c4832a70e26e4901d024ed4b
(cherry picked from commit 170b97fa45342622b476df3a89bcd3154056ce65)

4 years agoremove outdated integrityerror example
Mike Bayer [Wed, 26 May 2021 16:13:30 +0000 (12:13 -0400)] 
remove outdated integrityerror example

Fixes: #5372
Change-Id: Ibf7c9969be543e38cd0c4773c413f085a57d94ab
(cherry picked from commit 4befa30bdb155e03808968f8fc6b32f39976177d)

4 years agofix typo
Mike Bayer [Thu, 29 Apr 2021 21:44:17 +0000 (17:44 -0400)] 
fix typo

Change-Id: I664eb4f4c023ec41d51c444919ca4b6867267738
(cherry picked from commit 62527a9824fb0491ba5f165f875b57f5e5dc45c3)

4 years agofix mapper._primary_key_propkeys
Mike Bayer [Thu, 29 Apr 2021 16:03:47 +0000 (12:03 -0400)] 
fix mapper._primary_key_propkeys

Fixed issue in :meth:`_orm.Session.bulk_save` when used with persistent
objects which would fail to track the primary key of mappings where the
column name of the primary key were different than the attribute name.

Fixes: #6392
Change-Id: I9b89bf00f900b7d2287517249e4f9356f20f0bdb
(cherry picked from commit 7892cc30ad60ae450471b62f351b3beb66911892)

4 years agodont use context from other sections
Mike Bayer [Thu, 29 Apr 2021 12:44:30 +0000 (08:44 -0400)] 
dont use context from other sections

rewrite the "individual sessions" section
to not rely upon context from the previous section,
this is a bad habit and should be fixed whereever we can
find it becuase people click on individual sections out of
context.

Change-Id: I4f09c5a582808eba3dbf9ba362e2af22edf2f2c7

4 years agoRemove session.begin() example that was for 1.4
Mike Bayer [Thu, 29 Apr 2021 12:31:57 +0000 (08:31 -0400)] 
Remove session.begin() example that was for 1.4

the isolation level example here was likely cherry-picked
from 1.4 ; "with session.begin()" isn't normally available
in 1.3.   will also update the 1.4 example for clarity

Change-Id: Ib86019f4b1b70392079596604ec9b0319941e4dc

4 years agoapply **kw to SchemaEventTarget._set_parent
Mike Bayer [Thu, 15 Apr 2021 16:32:04 +0000 (12:32 -0400)] 
apply **kw to SchemaEventTarget._set_parent

Fixed issue in the ``SchemaEventTarget._set_parent`` method that was
missing ``**kw`` in its argument signature which was added to this private
method as part of :ticket:`6152`. The method is not invoked internally, but
could potentially be used by a third party system, as well as that the lack
of a proper signature could be misleading in debugging other issues.

Change-Id: I00dce3e533183969b09946f3e918cb30e1154623
References: #6282

4 years agoMerge "Update wheel workflow to match 1.4" into rel_1_3
mike bayer [Mon, 12 Apr 2021 19:32:22 +0000 (19:32 +0000)] 
Merge "Update wheel workflow to match 1.4" into rel_1_3

4 years agoFix error in documentation of DDLElement
Federico Caselli [Fri, 9 Apr 2021 22:31:51 +0000 (00:31 +0200)] 
Fix error in documentation of DDLElement

Change-Id: I9d850458c274d245057ea676d6730d4bd93c261f
(cherry picked from commit c77274a45092352e8dd62b29e9aea8d0953a1313)

4 years agoupdate .Unicode documentation
Mike Bayer [Sat, 10 Apr 2021 15:51:47 +0000 (11:51 -0400)] 
update .Unicode documentation

to reflect the modernization that was already done in
String.

Fixes: #6238
Change-Id: I92c667b45f040c6dad431c53d89d01fdcc2a2a2a
(cherry picked from commit 78b66780092768b2bdd5299accdcef1f2e5d3a52)

4 years agoUpdate wheel workflow to match 1.4
Federico Caselli [Fri, 9 Apr 2021 20:40:02 +0000 (22:40 +0200)] 
Update wheel workflow to match 1.4

Change-Id: Ia88937e81860a6af1dcad6cfe07c8cee9c6bfedd

4 years agochange sql to schema
Mike Bayer [Tue, 6 Apr 2021 22:49:58 +0000 (18:49 -0400)] 
change sql to schema

Change-Id: Ida93320d9b57e076786acc73a1c835cf1961675f
(cherry picked from commit dea0ac910ff941d5bbba0d922fb6eff5890d197c)

4 years agoTable arguments name and metadata are positional only
Federico Caselli [Mon, 5 Apr 2021 19:57:24 +0000 (21:57 +0200)] 
Table arguments name and metadata are positional only

The :class:`_sql.Table` object now raises an informative error message if
it is instantiated without passing at least the :paramref:`_sql.Table.name`
and :paramref:`_sql.Table.metadata` arguments positionally. Previously, if
these were passed as keyword arguments, the object would silently fail to
initialize correctly.

Fixes: #6135
Change-Id: I54d0c89fd549fc504289a87ea0bb37369f982b06
(cherry picked from commit 3de954bc027ebf655e7ed26c83cfb3fd4b7b5edf)

4 years agoBug fix for code example
Edward Betts [Sun, 4 Apr 2021 07:40:07 +0000 (08:40 +0100)] 
Bug fix for code example

Correct a mistake in a code example.

(cherry picked from commit 18fef6af669762a11c7f4da5de1dd42b3bbc2a55)

4 years agoCorrect for Variant + ARRAY cases in psycopg2
Mike Bayer [Thu, 1 Apr 2021 16:26:06 +0000 (12:26 -0400)] 
Correct for Variant + ARRAY cases in psycopg2

Fixed regression caused by :ticket:`6023` where the PostgreSQL cast
operator applied to elements within an :class:`_types.ARRAY` when using
psycopg2 would fail to use the correct type in the case that the datatype
were also embedded within an instance of the :class:`_types.Variant`
adapter.

Additionally, repairs support for the correct CREATE TYPE to be emitted
when using a ``Variant(ARRAY(some_schema_type))``.

Fixes: #6182
Change-Id: I1b9ba7c876980d4650715a0b0801b46bdc72860d
(cherry picked from commit 43e98c75bde96ef27daeaf7fbfbea30b7eb7c295)

4 years agodont import typing on Python 3.4
Mike Bayer [Wed, 31 Mar 2021 13:58:19 +0000 (09:58 -0400)] 
dont import typing on Python 3.4

Repaired an import for "typing" that is not supported in Python 3.4, which
is the bottom version supported by SQLAlchemy 1.3.

Fixes: #6168
Change-Id: I282c04be0dd40e2b6d5dc3c7f7dad65746d60008

4 years agoVersion 1.3.25 placeholder
Mike Bayer [Tue, 30 Mar 2021 23:04:53 +0000 (19:04 -0400)] 
Version 1.3.25 placeholder

4 years ago- 1.3.24 rel_1_3_24
Mike Bayer [Tue, 30 Mar 2021 22:58:27 +0000 (18:58 -0400)] 
- 1.3.24

4 years agoAdjust version numbers for some changes, tags
Mike Bayer [Tue, 30 Mar 2021 22:57:25 +0000 (18:57 -0400)] 
Adjust version numbers for some changes, tags

Change-Id: I53263bd27a9012f1c41a2c491441c5fed79df673
(cherry picked from commit 8ecfecefe81f4fef6ed30ad46b7a36d76e3ea14b)

4 years agoRefine domain nullable rules for PostgreSQL reflection
Mike Bayer [Tue, 30 Mar 2021 18:48:41 +0000 (14:48 -0400)] 
Refine domain nullable rules for PostgreSQL reflection

Fixed issue in PostgreSQL reflection where a column expressing "NOT NULL"
will supersede the nullability of a corresponding domain.

Fixes #6161

Change-Id: I1a3de49afcdb952f71bd7a7cc7b264513c93eff5
(cherry picked from commit ab61d66dee9b3c3639907557852908858daacb6f)

4 years agoTypeDecorator passes "outer" flag to itself for set_parent accounting
Mike Bayer [Mon, 29 Mar 2021 21:57:20 +0000 (17:57 -0400)] 
TypeDecorator passes "outer" flag to itself for set_parent accounting

Fixed bug first introduced in as some combination of :ticket:`2892`,
:ticket:`2919` nnd :ticket:`3832` where the attachment events for a
:class:`_types.TypeDecorator` would be doubled up against the "impl" class,
if the "impl" were also a :class:`_types.SchemaType`. The real-world case
is any :class:`_types.TypeDecorator` against :class:`_types.Enum` or
:class:`_types.Boolean` would get a doubled
:class:`_schema.CheckConstraint` when the ``create_constraint=True`` flag
is set.

Fixes: #6152
Change-Id: I3218b7081297270c132421f6765b5c3673d10a5c
(cherry picked from commit 3b18c9db3a81dfeec6de33e7e2ffbd8d265d1d79)

4 years agoAllow dropping a schema with a sequence shared by more than one table.
Federico Caselli [Fri, 19 Mar 2021 23:06:32 +0000 (00:06 +0100)] 
Allow dropping a schema with a sequence shared by more than one table.

Fixes: #6071
Change-Id: I5c4483abf075622cccb73cb4c4f8c873174b4e32
(cherry picked from commit 158346a98bcaa28d44f34b194aac75cadd76f1ad)

4 years agoRemove unneeded import
Mike Bayer [Tue, 16 Mar 2021 22:16:17 +0000 (18:16 -0400)] 
Remove unneeded import

this import forgot to get removed from
Ia7519ac4371a635f05ac69a3a4d0f4e6d2f04cad , removing it
in post-production.

We will need "enum" soon enough when we go to Python 3 only.

Change-Id: I28297c2ed9f87fd0841076b861b8eeb610754dc3
(cherry picked from commit ecb392c5f927ab117f9704ce373bf2af1dbe5b69)

4 years agoCAST the elements in ARRAYs when using psycopg2
Federico Caselli [Wed, 10 Mar 2021 22:54:52 +0000 (23:54 +0100)] 
CAST the elements in ARRAYs when using psycopg2

Adjusted the psycopg2 dialect to emit an explicit PostgreSQL-style cast for
bound parameters that contain ARRAY elements. This allows the full range of
datatypes to function correctly within arrays. The asyncpg dialect already
generated these internal casts in the final statement. This also includes
support for array slice updates as well as the PostgreSQL-specific
:meth:`_postgresql.ARRAY.contains` method.

Fixes: #6023
Change-Id: Ia7519ac4371a635f05ac69a3a4d0f4e6d2f04cad
(cherry picked from commit dfa1d3b28f1a0abf1e11c76a94f7a65bf98d29af)

4 years agodocumentation updates
Mike Bayer [Mon, 15 Mar 2021 14:15:48 +0000 (10:15 -0400)] 
documentation updates

Change-Id: I43d0e8de1f90abcff4b278637808d1ebc8fd6c97
(cherry picked from commit 755316e66e0543f2524aeef0f11c107f95420d8a)

4 years agoAdded import of synonym in example code in Synonym portion of docs
Andres Torres [Tue, 9 Mar 2021 06:20:04 +0000 (22:20 -0800)] 
Added import of synonym in example code in Synonym portion of docs

(cherry picked from commit 4f857567923ccdbd18dae7a4aa98db040d396e57)

4 years agoFix named CHECK constraint name omitted on repeated creates
Gord Thompson [Sat, 6 Mar 2021 19:19:13 +0000 (12:19 -0700)] 
Fix named CHECK constraint name omitted on repeated creates

Fixed issue where the CHECK constraint generated by :class:`_types.Boolean`
or :class:`_types.Enum` would fail to render the naming convention
correctly after the first compilation, due to an unintended change of state
within the name given to the constraint. This issue was first introduced in
0.9 in the fix for issue #3067, and the fix revises the approach taken at
that time which appears to have been more involved than what was needed.

Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #6007
Change-Id: I7ecff0a9d86191520f6841b3922a5af5a6971fba
(cherry picked from commit 506b88de5e428fd4ad2feff663ba53e2dbb28891)

4 years agoensure composite refresh handler synced w/ mutable composite
Mike Bayer [Fri, 5 Mar 2021 04:38:34 +0000 (23:38 -0500)] 
ensure composite refresh handler synced w/ mutable composite

Fixed issue where the :class:`_mutable.MutableComposite` construct could be
placed into an invalid state when the parent object was already loaded, and
then covered by a subsequent query, due to the composite properties'
refresh handler replacing the object with a new one not handled by the
mutable extension.

Fixes: #6001
Change-Id: Ieebd8e6afe6b65f8902cc12dec1efb968f5438ef
(cherry picked from commit 2f7623b6b265cd5f25f2a6022e21bc3286d397a3)

4 years agoFix aggregate_order_by issue
Gord Thompson [Thu, 4 Mar 2021 13:55:53 +0000 (06:55 -0700)] 
Fix aggregate_order_by issue

Fixes: #5989
Using array_agg() with aggregate_order_by() in
postgresql would sometimes return ARRAY(NullType)
instead of ARRAY(actual_type).

Change-Id: I05a0b2b7ea59291e3c04575578adcc337296e5a8
(cherry picked from commit 780213bfefac7046ac889ffbc1c51e0d244dd678)

4 years agouse zimports 0.3
Mike Bayer [Thu, 4 Mar 2021 16:11:48 +0000 (11:11 -0500)] 
use zimports 0.3

Change-Id: Ice8b9f9c1ef1446b6813e5bc9332f1323234cb5f

4 years agoRemove passive_deletes warning for many-to-one
Mike Bayer [Tue, 2 Mar 2021 23:48:08 +0000 (18:48 -0500)] 
Remove passive_deletes warning for many-to-one

Removed very old warning that states that passive_deletes is not intended
for many-to-one relationships. While it is likely that in many cases
placing this parameter on a many-to-one relationship is not what was
intended, there are use cases where delete cascade may want to be
disallowed following from such a relationship.

Change-Id: I07adb726633f73f26296add4ec70376d5dcf8817
References: #5983
(cherry picked from commit a63b23392fc31766e32b8650127d9006ee189a0f)

4 years agoAs of 1.1, there are five object states
John Whitlock [Wed, 24 Feb 2021 15:41:02 +0000 (09:41 -0600)] 
As of 1.1, there are five object states

(cherry picked from commit d5a4965e286602caecbbfd640a40cc6619a7da36)

Change-Id: I3ae84e45db3df3c0e750589c0bec57861b6aa6a6

4 years agodoc clarification re: schema translate
Mike Bayer [Mon, 1 Mar 2021 12:33:13 +0000 (07:33 -0500)] 
doc clarification re: schema translate

add tip that ORM session should use an option engine for schema
translate

Change-Id: I5807b486275cac72087be5217fff7c878783435f
References: #5978
(cherry picked from commit da1bc669d59f06982356c69039512ef4f5c6950b)

4 years agodocument TypeDecorator schemes for MONEY
Mike Bayer [Mon, 22 Feb 2021 14:55:21 +0000 (09:55 -0500)] 
document TypeDecorator schemes for MONEY

this type apparently returns strings so document
cast/processing options.

Change-Id: Idc19527dcf76e1c2d966425716c0fcf60cbba5dc
References: #5965
(cherry picked from commit fcf539d090a95fb179ca03beffd10122e97aa002)

4 years agoFix test that incorrectly used ; as query separator
Federico Caselli [Thu, 18 Feb 2021 21:20:29 +0000 (22:20 +0100)] 
Fix test that incorrectly used ; as query separator

Change-Id: I31e9973930d90184bbabda0bff6346eca4e00c37
(cherry picked from commit 149261e81ca255b1be397ae4500f262c7bb46bac)

4 years agoExtract table names when comparing to nrte error
Mike Bayer [Thu, 18 Feb 2021 15:43:16 +0000 (10:43 -0500)] 
Extract table names when comparing to nrte error

Fixed issue where the process of joining two tables could fail if one of
the tables had an unrelated, unresolvable foreign key constraint which
would raise :class:`_exc.NoReferenceError` within the join process, which
nonetheless could be bypassed to allow the join to complete. The logic
which tested the exception for signficance within the process would make
assumptions about the construct which would fail.

Fixes: #5952
Change-Id: I492dacd082ddcf8abb1310ed447a6ed734595bb7
(cherry picked from commit 498db831718cb5df213b1afdd2027878e0e72fd4)

4 years agoUpdate declarative_mixins.rst
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.

(cherry picked from commit f41b9cbcdb0b6116cc3e2d15f53983516d82b06d)

Change-Id: I084ec293b948a4b594f210e758ca0a05483ca8da

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
(cherry picked from commit f18531fd315e50cffa18b01c3be4eb585c4a3364)

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

(cherry picked from commit d1806bb5ed4c0ee150b69b5226f8af835d6e1012)

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
(cherry picked from commit f6188d31998321a857078d6a61672aae1f98e312)

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
(cherry picked from commit 2385ebb19366efeb35415298166ac18668864c51)

4 years agoPrecede sp_columns with EXEC
Mike Bayer [Fri, 5 Feb 2021 14:34:25 +0000 (09:34 -0500)] 
Precede sp_columns with EXEC

Fixed issue regarding SQL Server reflection for older SQL Server 2005
version, a call to sp_columns would not proceed correctly without being
prefixed with the EXEC keyword. This method is not used in current 1.4
series.

Fixes: #5921
Change-Id: I2ffcda97d570879719ec5c1ea9fb7507dc87756f

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

(cherry picked from commit 2c7e78be96a33902927f911429849a2ccfbcfc9b)

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
(cherry picked from commit 9660e94e35be438b0d51cd87e6ccb4047a332c15)

4 years agoVersion 1.3.24 placeholder
Mike Bayer [Mon, 1 Feb 2021 20:56:44 +0000 (15:56 -0500)] 
Version 1.3.24 placeholder

4 years ago- 1.3.23 rel_1_3_23
Mike Bayer [Mon, 1 Feb 2021 20:52:15 +0000 (15:52 -0500)] 
- 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
(cherry picked from commit fc1e419d139711117b0d2451d6b6e11045afeeb3)

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
(cherry picked from commit 81896c31ffc4db081f1f2bba199a52328398a236)

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
(cherry picked from commit aff54c0bd8f75d324f1a4a8601a3d6f28739439e)

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.

Also backporting the statement cache clear added to master
in f1e96cb087 , as we are testing in CI against two oracle
versions now there are sporadic failures that appear to be
memory related.

Fixes: #5812
Change-Id: I666f893e762dfa4d34dd2e324480565b226fb3a4
(cherry picked from commit 03179a96bfb9dd7ce17274fed44908c25229dedf)

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
(cherry picked from commit 57db20a187e80950037dd5a2141a560fe879e054)

4 years agoun-ignore mike's favorite testing filenames
Mike Bayer [Sun, 24 Jan 2021 22:30:32 +0000 (17:30 -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: I97e04af0672a609e44d0479d5c10d063a3482dfc

4 years agoMerge "Set upper bound to pg8000 version" into rel_1_3
mike bayer [Sun, 24 Jan 2021 21:41:32 +0000 (21:41 +0000)] 
Merge "Set upper bound to pg8000 version" into rel_1_3

4 years agoSet upper bound to pg8000 version
Giuseppe Lumia [Sat, 23 Jan 2021 18:04:44 +0000 (13:04 -0500)] 
Set upper bound to pg8000 version

For SQLAlchemy 1.3 only, setup.py pins pg8000 to a version lower than
1.16.6. Version 1.16.6 and above is supported by SQLAlchemy 1.4. Pull
request courtesy Giuseppe Lumia.

Fixes: #5645
Closes: #5864
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5864
Pull-request-sha: c1b39d22fff8bfd0fe599103996881cc1dc0ca66

Change-Id: Ibb8cec75cf8d82e1072772cb779a9a794530b8f0

4 years agoMerge "remove __allowlist__" into rel_1_3
mike bayer [Sat, 23 Jan 2021 19:24:58 +0000 (19:24 +0000)] 
Merge "remove __allowlist__" into rel_1_3

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

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
(cherry picked from commit 20a15345a3f1e4755613d908a3d3cfe1bfe35c6c)

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
(cherry picked from commit f6fca84a7ffc71d743bea22e688ef3c944ba545b)

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
(cherry picked from commit 33886b8692fc9a9cf862386a541d15114a659f43)

4 years agoMerge "Add mssql+turbodbc to external dialect list" into rel_1_3
mike bayer [Fri, 15 Jan 2021 14:54:21 +0000 (14:54 +0000)] 
Merge "Add mssql+turbodbc to external dialect list" into rel_1_3

4 years agoUse UnsupportedCompilationError for no default compiler
Mike Bayer [Thu, 14 Jan 2021 16:18:58 +0000 (11:18 -0500)] 
Use UnsupportedCompilationError for no default compiler

Fixed issue where the stringification that is sometimes called when
attempting to generate the "key" for the ``.c`` collection on a selectable
would fail if the column were an unlabeled custom SQL construct using the
``sqlalchemy.ext.compiler`` extension, and did not provide a default
compilation form; while this seems like an unusual case, it can get invoked
for some ORM scenarios such as when the expression is used in an "order by"
in combination with joined eager loading.  The issue is that the lack of a
default compiler function was raising :class:`.CompileError` and not
:class:`.UnsupportedCompilationError`.

Fixes: #5836
Change-Id: I5af243b2c70c7dcca4b212a3869c3017a50c132b
(cherry picked from commit b4c6cfc2fde6c652e79ca157f8023a3f8941bc3c)

4 years agoAdd mssql+turbodbc to external dialect list
Gord Thompson [Tue, 12 Jan 2021 19:58:22 +0000 (12:58 -0700)] 
Add mssql+turbodbc to external dialect list

Fixes: #5834
Change-Id: I1f207b84751e7e3425aa9e8e393787eeb9b595b7
(cherry picked from commit 3c53cfaaf5cd7d224896db07744095f199723315)

4 years agoprovide FAQ entry for percent sign escaping in SQL compiler
Mike Bayer [Wed, 13 Jan 2021 14:06:50 +0000 (09:06 -0500)] 
provide FAQ entry for percent sign escaping in SQL compiler

this is coming up more than once so provide a document

Change-Id: I23dcd4c7a6527b2f33502e67ffad4335f895e6f9
(cherry picked from commit 0a41f9bea6602c52c59af0f7b572308b2c2b27ab)

4 years agoMerge "Remove special rule for TypeDecorator of TypeDecorator" into rel_1_3
mike bayer [Thu, 7 Jan 2021 20:59:25 +0000 (20:59 +0000)] 
Merge "Remove special rule for TypeDecorator of TypeDecorator" into rel_1_3

4 years agoUpdate connect args for pymysql 1.0.0; aiomysql fixes
Mike Bayer [Thu, 7 Jan 2021 17:20:51 +0000 (12:20 -0500)] 
Update connect args for pymysql 1.0.0; aiomysql fixes

Fixed deprecation warnings that arose as a result of the release of PyMySQL
1.0, including deprecation warnings for the "db" and "passwd" parameters
now replaced with "database" and "password".

For the 1.4 version of this patch, we are also changing tox.ini
to refer to a local branch of aiomysql that fixes pymysql
compatibility issues.

Fixes: #5821
Change-Id: I93876b52b2d96b52308f22aeb4f244ac5766a82f
(cherry picked from commit 489301137a4d76e5a46d754ae9c91aad2b3d2c1f)

4 years agoRemove special rule for TypeDecorator of TypeDecorator
Mike Bayer [Tue, 5 Jan 2021 13:48:36 +0000 (08:48 -0500)] 
Remove special rule for TypeDecorator of TypeDecorator

Removing this check for "TypeDecorator" in impl seems to not
break anything and allows TypeDecorator.with_variant() to
work correctly.   The line has been traced back to 2007 and
does not appear to have relevance today.

Fixed bug where making use of the :meth:`.TypeEngine.with_variant` method
on a :class:`.TypeDecorator` type would fail to take into account the
dialect-specific mappings in use, due to a rule in :class:`.TypeDecorator`
that was instead attempting to check for chains of :class:`.TypeDecorator`
instances.

Fixes: #5816
Change-Id: Ic86d9d985810e3050f15972b4841108acca2fa3e
(cherry picked from commit 458f83c6d213a80c2f0353b96421de36aee705f3)

4 years agoCheck for column expr in Oracle RETURNING check
Mike Bayer [Mon, 4 Jan 2021 22:05:46 +0000 (17:05 -0500)] 
Check for column expr in Oracle RETURNING check

Fixed regression in Oracle dialect introduced by :ticket:`4894` in
SQLAlchemy 1.3.11 where use of a SQL expression in RETURNING for an UPDATE
would fail to compile, due to a check for "server_default" when an
arbitrary SQL expression is not a column.

Fixes: #5813
Change-Id: I1977bb49bc971399195015ae45e761f774f4008d
(cherry picked from commit ea467fccbe4337929b91e0daec12b8672fa7907c)

4 years agohappy new year
Mike Bayer [Mon, 4 Jan 2021 14:51:04 +0000 (09:51 -0500)] 
happy new year

Change-Id: Ie6171eedea1d409bd0c570b55f94a82ba19ea58c

4 years agoSupport casting to ``FLOAT`` in MySQL and MariaDb.
Federico Caselli [Wed, 30 Dec 2020 19:36:27 +0000 (20:36 +0100)] 
Support casting to ``FLOAT`` in MySQL and MariaDb.

Fixes: #5808
Change-Id: I8106ddcf681eec3cb3a67d853586702f6e844b9d
(cherry picked from commit 0da7225ac16b966c1cc5f1b2afde4eb6856183aa)

4 years agonarrow the check for double-paren exprs in mysql create_index
Mike Bayer [Sat, 26 Dec 2020 16:16:51 +0000 (11:16 -0500)] 
narrow the check for double-paren exprs in mysql create_index

Fixed regression from SQLAlchemy 1.3.20 caused by the fix for
:ticket:`5462` which adds double-parenthesis for MySQL functional
expressions in indexes, as is required by the backend, this inadvertently
extended to include arbitrary :func:`_sql.text` expressions as well as
Alembic's internal textual component,  which are required by Alembic for
arbitrary index expressions which don't imply double parenthesis.  The
check has been narrowed to include only binary/ unary/functional
expressions directly.

Fixes: #5800
Change-Id: I40f83c6f9dd04b984d0c86eba632a588570709a1
(cherry picked from commit e81bc1f098ea40cf38ec4e4007c11c7f3ffc9712)

4 years agotest fixes for oracle 18c, for rel_1_3
Mike Bayer [Fri, 18 Dec 2020 15:46:20 +0000 (10:46 -0500)] 
test fixes for oracle 18c, for rel_1_3

Change-Id: I4968aa3bde3c4d11d7fe84f18b4a846ba357d16a

4 years agoVersion 1.3.23 placeholder
Mike Bayer [Fri, 18 Dec 2020 21:11:56 +0000 (16:11 -0500)] 
Version 1.3.23 placeholder

4 years ago- 1.3.22 rel_1_3_22
Mike Bayer [Fri, 18 Dec 2020 21:05:31 +0000 (16:05 -0500)] 
- 1.3.22

4 years agoGracefully degrade on v$transaction not readable
Mike Bayer [Fri, 18 Dec 2020 14:28:06 +0000 (09:28 -0500)] 
Gracefully degrade on v$transaction not readable

Fixed regression which occured due to [ticket:5755] which implemented
isolation level support for Oracle.   It has been reported that many Oracle
accounts don't actually have permission to query the ``v$transaction``
view so this feature has been altered to gracefully fallback when it fails
upon database connect, where the dialect will assume "READ COMMITTED" is
the default isolation level as was the case prior to SQLAlchemy 1.3.21.
However, explicit use of the :meth:`_engine.Connection.get_isolation_level`
method must now necessarily raise an exception, as Oracle databases with
this restriction explicitly disallow the user from reading the current
isolation level.

Fixes: #5784
Change-Id: Iefc82928744f3c944c18ae8000eb3c9e52e523bc
(cherry picked from commit 566f1b520e05659ba4d4928c740a9aa1b0fed614)

4 years agoVersion 1.3.22 placeholder
Mike Bayer [Thu, 17 Dec 2020 17:35:20 +0000 (12:35 -0500)] 
Version 1.3.22 placeholder

4 years ago- 1.3.21 rel_1_3_21
Mike Bayer [Thu, 17 Dec 2020 17:27:41 +0000 (12:27 -0500)] 
- 1.3.21

4 years agofix changelog links
Mike Bayer [Thu, 17 Dec 2020 17:21:42 +0000 (12:21 -0500)] 
fix changelog links

Change-Id: Iec06b8e15967bcbf38ae091035b2beb13706f339

4 years agoCheck explicitly for mapped class as secondary
Mike Bayer [Tue, 15 Dec 2020 14:45:48 +0000 (09:45 -0500)] 
Check explicitly for mapped class as secondary

Added a comprehensive check and an informative error message for the case
where a mapped class, or a string mapped class name, is passed to
:paramref:`_orm.relationship.secondary`.  This is an extremely common error
which warrants a clear message.

Additionally, added a new rule to the class registry resolution such that
with regards to the :paramref:`_orm.relationship.secondary` parameter, if a
mapped class and its table are of the identical string name, the
:class:`.Table` will be favored when resolving this parameter.   In all
other cases, the class continues to be favored if a class and table
share the identical name.

Fixes: #5774
Change-Id: I65069d79c1c3897fbd1081a8e1edf3b63b497223
(cherry picked from commit cfcfb7d43c2719ef6e4901dca43de5b492a1f08f)

4 years agoUse .expression accessor for hybrid example
Mike Bayer [Tue, 15 Dec 2020 13:52:15 +0000 (08:52 -0500)] 
Use .expression accessor for hybrid example

hybrids since 1.1 use InstrumentedAttribute at the expression
level, so this doc needed to illustrate how to get at the
SQL expression.  Also added a docstring for
QueryableAttribute.expression.

Fixes: #5773
Change-Id: I4941d245ec947999abfa8e13f047e06a0bd47e5b
(cherry picked from commit 688b4ca6a7f2e32c580d616c6dea1e68b7398fd2)

4 years agoImplement Oracle SERIALIZABLE + real read of isolation level
Mike Bayer [Wed, 9 Dec 2020 03:07:48 +0000 (22:07 -0500)] 
Implement Oracle SERIALIZABLE + real read of isolation level

There's some significant awkwardness in that we can't
read the level unless a transaction is started, which normally
does not occur unless DML is emitted.  The implementation
uses the local_transaction_id function to start a transaction.
It is not known what the performance impact of this might
have, however by default the function is called only once
on first connect and later only if the get_isolation_level()
method is used.

Fixes: #5755
Change-Id: I0453a6b0a49420826707f660931002ba2338fbf0
(cherry picked from commit 7528c2465b3e56ed094f155bff2a3ab8c89cc84f)

4 years agoFixed compile for mssql dialect
Gord Thompson [Tue, 8 Dec 2020 20:23:02 +0000 (15:23 -0500)] 
Fixed compile for mssql dialect

Fixed string compilation when both mssql_include and mssql_where are used

Fixes: #5751
Closes: #5752
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5752
Pull-request-sha: aa57ad5d93cd69bf7728d864569c31c7e59b54fb

Change-Id: I1201170affd9911c252df5c9b841e538bb577085
(cherry picked from commit 6f8b035c7808fea13bae50995206c9b2ded91f51)

4 years agoMerge "Reflect decimal points in MariaDB non-quoted numeric defaults" into rel_1_3
mike bayer [Thu, 3 Dec 2020 17:39:51 +0000 (17:39 +0000)] 
Merge "Reflect decimal points in MariaDB non-quoted numeric defaults" into rel_1_3