]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
5 years agoFix mssql dialect escaping object names containing ']'
Gord Thompson [Sat, 18 Jul 2020 00:06:41 +0000 (18:06 -0600)] 
Fix mssql dialect escaping object names containing ']'

Fixes: #5467
Change-Id: I054ec219717ba62847a9daf1214e215dd6b70633
(cherry picked from commit 547e959157f841f4f6d1e405ceed14755fcbd0bd)

5 years agoAdd requirement for test_get_view_definition
Gord Thompson [Wed, 15 Jul 2020 22:00:56 +0000 (16:00 -0600)] 
Add requirement for test_get_view_definition

Bypass the test if the views are not being created.

Change-Id: I3945acb418575d12e5fe0e4657eb5e3b1c08b90e
(cherry picked from commit 6158fe6cbf69c29d51a8e57aab4e36d6b4598079)

5 years agoRepair doubled "using engines in fork()" section
Mike Bayer [Wed, 15 Jul 2020 23:14:46 +0000 (19:14 -0400)] 
Repair doubled "using engines in fork()" section

This section was written twice in two different ways with
the same recipe.  consolidate into one section and
add additional caveats regading dispose.

Change-Id: I20524935e7c10e3624d561ea2735312fd04e673d
References: #5460
(cherry picked from commit f4aa9def8f35136d1fe3bba81aaeddb72e7772a2)

5 years agoMerge "Add missing function to documentation: cte, Exits" into rel_1_3
mike bayer [Mon, 13 Jul 2020 19:08:46 +0000 (19:08 +0000)] 
Merge "Add missing function to documentation: cte, Exits" into rel_1_3

5 years agotest single and double quote inspection scenarios
Mike Bayer [Mon, 13 Jul 2020 14:49:57 +0000 (10:49 -0400)] 
test single and double quote inspection scenarios

Applied a sweep through all included dialects to ensure names that contain
single or double quotes are properly escaped when querying system tables,
for all :class:`.Inspector` methods that accept object names as an argument
(e.g. table names, view names, etc).   SQLite and MSSQL contained two
quoting issues that were repaired.

Fixes: #5456
Change-Id: I3bc98806f5166f3d82275650079ff561446f2aef
(cherry picked from commit 4351f7183c81bdb64a9a3ba47aa4b9891f42ffdb)

5 years agoMerge "more docs for autocommit isolation level" into rel_1_3
mike bayer [Mon, 13 Jul 2020 03:28:53 +0000 (03:28 +0000)] 
Merge "more docs for autocommit isolation level" into rel_1_3

5 years agomore docs for autocommit isolation level
Mike Bayer [Sun, 12 Jul 2020 23:52:54 +0000 (19:52 -0400)] 
more docs for autocommit isolation level

this concept is not clear that we offer real
DBAPI autocommit everywhere.  backport 1.3 with edits
as well

Change-Id: I2e8328b7fb6e1cdc5453ab29c94276f60c7ca149
(cherry picked from commit 28fbb0cb94ddf92a014adbfe63a15b7d0797ccee)

5 years agoMake call-count profiling tests on osx have their own platform key
Federico Caselli [Sat, 11 Jul 2020 17:03:46 +0000 (19:03 +0200)] 
Make call-count profiling tests on osx have their own platform key

They previously would use the linux profiles, but recently some discrepancies in
the function call count on osx would make the tests fail.

Change-Id: Ifdfdca1676972de4179f59cdaae196f6805d4a21
(cherry picked from commit 2ada9686ffb86d39ea25aa146593dde2340fee03)

5 years agoLimit init_subclass test above python 3.6
Mike Bayer [Wed, 8 Jul 2020 19:48:32 +0000 (15:48 -0400)] 
Limit init_subclass test above python 3.6

The commit for I1654befe9eb1c8b8e7fc0784bdbe64284614f0ea #5357
runs the test on all Python 3 versions, however we need to limit
at least python 3.6 for this.

Change-Id: Ie86b78bbfd8c7bd013ff9aa7f8905328d792c1b3
(cherry picked from commit 43a111e326acae85f4623b8dd507468d99d5ef3a)

5 years agoPropose --nomemory by default
Mike Bayer [Wed, 8 Jul 2020 19:32:38 +0000 (15:32 -0400)] 
Propose --nomemory by default

the memory tests are solely responsible for the largest chunk of
time and CPU energy taken up in running the tests.   Regressions
in this area are nonexistent unless major changes are being
taken up.   Try to revert them to False and see if a single
gerrit job can perhaps run these.

Change-Id: Ibaead2d1c0a76f1339bee63652a8aead689e8b75
(cherry picked from commit e2d4b2e72cb97bc5612fa9d1ec7d0ab15d38efe1)

5 years agoresolves #3757
RamonWill [Sat, 4 Jul 2020 17:17:40 +0000 (18:17 +0100)] 
resolves #3757

(cherry picked from commit cf7bfb79847266148f6add22120479d287a259ab)

5 years agoMerge "Add **kw support to DeclarativeMeta.__init__" into rel_1_3
mike bayer [Tue, 7 Jul 2020 00:18:31 +0000 (00:18 +0000)] 
Merge "Add **kw support to DeclarativeMeta.__init__" into rel_1_3

5 years agoadded semicolon (;) to improve warning message clarity
jonathan vanasco [Tue, 30 Jun 2020 16:31:58 +0000 (12:31 -0400)] 
added semicolon (;) to improve warning message clarity

### Description

Added a semicolon to improve the clarity of warning message.  I actually had a table named `backend`, and thought it was involved!

While updating the code, I noticed no test that directly tests for this warning message. There are tests for the `Can't sort tables for DROP;` prefix of this message and the `exc.CircularDependencyError`; and some tests for the `exc.CircularDependencyError` message itself. I couldn't find any test for this particular message though.  (Just thought I'd bring that up)

No issue created, because this is minor.

Closes: #5431
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5431
Pull-request-sha: 87fb5733ff4fc1a13dd94277716814ea852f654c

Change-Id: I87a504d30a7dd5155c34f7d7f30b2116d0d3cd3f
(cherry picked from commit b421c51b94fdef2bc542b0a40bfb21490b23ca15)

5 years agoAdd **kw support to DeclarativeMeta.__init__
EwenGillies [Sun, 5 Jul 2020 14:50:50 +0000 (10:50 -0400)] 
Add **kw support to DeclarativeMeta.__init__

Added a ``**kw`` argument to the :meth:`.DeclarativeMeta.__init__` method.
This allows a class to support the :pep:`487` metaclass hook
``__init_subclass__``.  Pull request courtesy Ewen Gillies.

Fixes: #5357
Closes: #5363
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5363
Pull-request-sha: 0ad05a768316cba03a4d312ab39d3e8fbca7ac54

Change-Id: I1654befe9eb1c8b8e7fc0784bdbe64284614f0ea
(cherry picked from commit 67504137e96547664754691bdd3269b473a488d1)

5 years agoConsolidate connection customization documentation
Mike Bayer [Mon, 6 Jul 2020 15:11:54 +0000 (11:11 -0400)] 
Consolidate connection customization documentation

1. move all discussion of how to customize connection
to the engines.rst section.   have the section in pooling.rst
point to engines.

2. ensure all of the common use cases for connection modification
are listed out in order of level of modification.   the use
case of modifying an existing connection is separate from that of
modifying how connect is called; ensure that poolevents.connect
is referred to just as prominently as dialectevents.do_connect.

3. completely replace any discussion of create_engine.creator, as this
hook does not offer anything beyond what do_connect() does.
"creator" is more about using a Pool object directly without an
Engine, which is no longer a documented use case.

Change-Id: Ibe366d2a6e63eb420a6136fdc71ce0fb545edf8f
(cherry picked from commit b5c4a4cbe632e7dfa243121377a4a8d73b4da1ab)

5 years agoDocument pyodbc built-in pooling
Mike Bayer [Sun, 5 Jul 2020 14:28:20 +0000 (10:28 -0400)] 
Document pyodbc built-in pooling

PyODBC apparently pools connections by default and this
is a module-wide setting only.    Documenent that this happens
and how to disable it.

Fixes: #5440
Change-Id: I415bda7beb2211c66991b6c804b0ddb4d79e427f
(cherry picked from commit 9204b6610c9667ba2e4f73440339d2f520631777)

5 years agoAdd missing function to documentation: cte, Exits
Federico Caselli [Tue, 30 Jun 2020 19:40:56 +0000 (21:40 +0200)] 
Add missing function to documentation: cte, Exits

Fixes: #5432
Change-Id: I22e4ba3a7131165c551bcba7e377fa45d71d70e0
(cherry picked from commit f2ec52c232dbbe59282e9b9740ede52887f9ee8d)

5 years agoInclude DATETIME / DateTime with the MySQL TIMESTAMP examples
Mike Bayer [Mon, 29 Jun 2020 19:45:20 +0000 (15:45 -0400)] 
Include DATETIME / DateTime with the MySQL TIMESTAMP examples

To eliminate any remaining confusion, clarify that
DATETIME (as well as DateTime) and TIMESTAMP are treated
similarly with the MySQL dialect regarding ON UPDATE.

Change-Id: I222522440706902d5d2d11e670e76f16000438e0
References: #5427
(cherry picked from commit 30f8843e97a49121323a4f75d9341f77c9935312)

5 years agoMerge "Provide example for exists" into rel_1_3
mike bayer [Mon, 29 Jun 2020 19:05:39 +0000 (19:05 +0000)] 
Merge "Provide example for exists" into rel_1_3

5 years agoDocuemnt current workarounds for MySQL TIMESTAMP
Mike Bayer [Mon, 29 Jun 2020 18:35:22 +0000 (14:35 -0400)] 
Docuemnt current workarounds for MySQL TIMESTAMP

MySQL 8 no longer generates the DEFAULT or ON UPDATE
clauses for TIMESTAMP by default, hence users will begin to hit
this regularly.  add warnings that this non-standard SQL is not
accommodated by server_onupdate and docuemnt the workaround
used in issues such as #4652.

Fixes: #5427
Change-Id: Ie048dcc91c648dd0b80ed395208c1d665b6c968b
(cherry picked from commit a2c2dcaf082ecf97c7e06cd23adf5a614b5a4a2b)

5 years agoProvide example for exists
Federico Caselli [Sat, 27 Jun 2020 19:46:28 +0000 (21:46 +0200)] 
Provide example for exists

Fixes: #5423
Change-Id: I716f8de17c49d7eefbbce5ddd9da203bfc9fe47f
(cherry picked from commit 90a97ad9b63d5aa80439a20e7a9db450026d58de)

5 years agoEnsure Oracle < 8 used for python 2 in tox
Mike Bayer [Mon, 29 Jun 2020 15:23:19 +0000 (11:23 -0400)] 
Ensure Oracle < 8 used for python 2 in tox

this is already in master, backporting to 1.3.

the issue of the oracle extras_require in setup.py
is a separate issue as master still has no version
qualification in this area either.

Change-Id: Ib612401aaa2d5d109b26bc18a0fc817a15a98bf8

5 years agoFix a wide variety of typos and broken links
aplatkouski [Thu, 25 Jun 2020 20:38:06 +0000 (16:38 -0400)] 
Fix a wide variety of typos and broken links

Cherry pick from I9c36e8d8804483950db4b42c38ee456e384c59e3

Signed-off-by: aplatkouski <5857672+aplatkouski@users.noreply.github.com>
Closes: #5416
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5416
Pull-request-sha: 8b742b67285d1fc16323cc23f63d539a6a9ae62e

Change-Id: I85985199858ec881eaea98fc190d12b459aeb733

5 years agoVersion 1.3.19 placeholder
Mike Bayer [Thu, 25 Jun 2020 19:00:50 +0000 (15:00 -0400)] 
Version 1.3.19 placeholder

5 years ago- 1.3.18 rel_1_3_18
Mike Bayer [Thu, 25 Jun 2020 18:33:21 +0000 (14:33 -0400)] 
- 1.3.18

5 years agoUse index name to determine if an index is for the PK
Mike Bayer [Thu, 25 Jun 2020 15:12:40 +0000 (11:12 -0400)] 
Use index name to determine if an index is for the PK

Fixed bug in Oracle dialect where indexes that contain the full set of
primary key columns would be mistaken as the primary key index itself,
which is omitted, even if there were multiples.  The check has been refined
to compare the name of the primary key constraint against the index name
itself, rather than trying to guess based on the columns present in the
index.

Fixes: #5421
Change-Id: I47c2ccdd0b13977cfd9ef249d4de06371c4fb241
(cherry picked from commit ca56d8dc32f939b2bdb1f590986d4c46d280d186)

5 years agoAdd pip list to workflow, update setuptools
Federico Caselli [Mon, 22 Jun 2020 18:01:38 +0000 (20:01 +0200)] 
Add pip list to workflow, update setuptools

Change-Id: I2e32ba315a79dcfc7c5f79ed6517ac0cee4f55e3
(cherry picked from commit 28c13f9092d457d9e476e2987ba9e83ae868407a)

5 years agoApply dialect_options copy fix
Gord Thompson [Sat, 6 Jun 2020 16:04:34 +0000 (10:04 -0600)] 
Apply dialect_options copy fix

Fixes: #5276
Change-Id: Ic608310d4a85934fc9fa4d72daef66323c6e2525
(cherry picked from commit 5d7d96b53ef6b046fcd4d19a42e31f99898d1c81)

5 years agoMerge "Propose black py27 + py35 mode for the rest of Py2K" into rel_1_3
mike bayer [Fri, 19 Jun 2020 21:44:28 +0000 (21:44 +0000)] 
Merge "Propose black py27 + py35 mode for the rest of Py2K" into rel_1_3

5 years agoAdd note indicating order of join() calls are important
Mike Bayer [Fri, 19 Jun 2020 15:06:08 +0000 (11:06 -0400)] 
Add note indicating order of join() calls are important

Fixes: #5406
Change-Id: I186792b32bd156d5ddf256dcd018af32ad5b515e
(cherry picked from commit 332b8b78f6ba728b0994457420cb66e1c9bd5846)

5 years agoPropose black py27 + py35 mode for the rest of Py2K
Mike Bayer [Fri, 19 Jun 2020 14:25:42 +0000 (10:25 -0400)] 
Propose black py27 + py35 mode for the rest of Py2K

py27 mode produces one failure for flake8 which is the
space added between exec and parenthesis.  however apparently
we can add multiple versions to target-versions which allows
the exec() calls to come out in python 3 style.

The issue we want to improve is issues of trailing
commas being added.  I'm not really able to get black to
consistently add or remove these trailing commas in any
case no matter what I set target-version towards.

Change-Id: Iceb9e9aeb5f5e0d317fb877ef06eca0290997fe4
(cherry picked from commit 5850dbca071a565cc00f613618b4fcddd13a5eee)

5 years agoAdd version token to error URL
Mike Bayer [Thu, 11 Jun 2020 18:31:57 +0000 (14:31 -0400)] 
Add version token to error URL

the sqlalche.me redirector now supports the numerical version
code in the URL, e.g. /13/, /14/, /20/, etc., so that we can
redirect to the error codes for the appropriate version
of SQLAlchemy in use without going through the catch-all "latest"
link.   If a particular version of the docs is no longer on the
site, the redirect will revert to falling through the "latest"
link (which ultimately lands on the current release version,
/13/ at the time of this writing).

Change-Id: I3bb463fd6fb6c8767c95a57f3699aba715a9a72d
(cherry picked from commit dbaf82d258cc12d92ef28de4677d147fdb7808fd)

5 years agoAdd 'exists' to SQLite's reserved keywords
Thodoris Sotiropoulos [Thu, 11 Jun 2020 14:50:41 +0000 (10:50 -0400)] 
Add 'exists' to SQLite's reserved keywords

Added "exists" to the list of reserved words for SQLite so that this word
will be quoted when used as a label or column name. Pull request courtesy
Thodoris Sotiropoulos.

Fixes: #5395
Closes: #5396
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5396
Pull-request-sha: 5608317a38db7b63115e3b467d182a3e5cc31580

Change-Id: Ia4769de2dec159dcf282eb4b30c11560da51a5c7
(cherry picked from commit ed4a4896aea7dd77dd5d8a9861302811ac421e47)

5 years agoAdd documentation regarding row constructo in PostgreSQL
Federico Caselli [Mon, 25 May 2020 19:43:58 +0000 (21:43 +0200)] 
Add documentation regarding row constructo in PostgreSQL

Fixes: #5331
Change-Id: Ia795a4d4d8ae4944d8a160d18f8b917177acf0de
(cherry picked from commit 95106a9175741528cebfde8b6d0fd9756f82bd20)

5 years agoMerge "Improve ``Rendering Bound Parameters Inline`` documentation" into rel_1_3
mike bayer [Thu, 11 Jun 2020 03:13:40 +0000 (03:13 +0000)] 
Merge "Improve ``Rendering Bound Parameters Inline`` documentation" into rel_1_3

5 years agoMerge "updated historical terms with modern equivalents" into rel_1_3
mike bayer [Tue, 9 Jun 2020 16:28:08 +0000 (16:28 +0000)] 
Merge "updated historical terms with modern equivalents" into rel_1_3

5 years agoFix capitalization typos in engines.rst
Abraham Sangha [Mon, 8 Jun 2020 16:17:09 +0000 (10:17 -0600)] 
Fix capitalization typos in engines.rst

(cherry picked from commit 6322cb20974b1d702b9fa0cfc07dbef2c549797c)

5 years agoupdated historical terms with modern equivalents
jonathan vanasco [Sat, 6 Jun 2020 01:58:23 +0000 (21:58 -0400)] 
updated historical terms with modern equivalents

### Description
There were a few remnant uses of master/slave in the code and docs. The project previously made a decision to move away from them to use modern and inclusive terminology.

This PR does not cover a bug or necessitate a documented entry into the changelog, so an issue ticket was not created.

### Checklist
This pull request is:

- [x] A documentation / typographical error fix
- [x] A short code fix
- [ ] A new feature implementation

Closes: #5381
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5381
Pull-request-sha: 92597e83d0e1e18960dbb39b604b313e7a1cbb30

Change-Id: I1fb34fe5ab6c19fd7360568d7b51cdea9d271b3b
(cherry picked from commit 3512d51600c250f72911313e3f204552c250ece7)

5 years agoFix connection string escaping for mssql+pyodbc
Gord Thompson [Thu, 4 Jun 2020 18:38:13 +0000 (12:38 -0600)] 
Fix connection string escaping for mssql+pyodbc

Fixes: #5373
Change-Id: Ia41e8f1ef8644c54d23ebfdf3f909c785adf0fb0
(cherry picked from commit 14bc09203a8b5b2bc001f764ad7cce6a184975cc)

5 years agoImprove ``Rendering Bound Parameters Inline`` documentation
Federico Caselli [Thu, 4 Jun 2020 17:53:29 +0000 (19:53 +0200)] 
Improve ``Rendering Bound Parameters Inline`` documentation

This is mainly to make this section more discoverable by users

Change-Id: I58ba19e4a9ae85b227e5b5553ba5c30c01f3e005
(cherry picked from commit 1f244416a01587b7c2ff8a1e42209332b7b821cc)

5 years agoDocument that type_coerce does not currently imply parenthesization
Mike Bayer [Thu, 4 Jun 2020 17:28:21 +0000 (13:28 -0400)] 
Document that type_coerce does not currently imply parenthesization

We've had a few issues where the current solution
is to use the self_group() method, so document that as
the current approach for the parenthesization use case.
Whether or not type_coerce() is changed later, this is
how it works at the moment.

Fixes: #5375
Change-Id: I97414762a87ec8f1fd1adc1b6be5a52e576814ca
References: #5344
(cherry picked from commit a4de30c50eb660a08c8d025c158c54a0bd84f051)

5 years agoMerge "Add default expression to query_expression()" into rel_1_3
mike bayer [Tue, 2 Jun 2020 17:56:40 +0000 (17:56 +0000)] 
Merge "Add default expression to query_expression()" into rel_1_3

5 years agoMerge "Support multiple dotted sections in mssql schema names" into rel_1_3
mike bayer [Mon, 1 Jun 2020 19:43:13 +0000 (19:43 +0000)] 
Merge "Support multiple dotted sections in mssql schema names" into rel_1_3

5 years agoSupport multiple dotted sections in mssql schema names
Mike Bayer [Mon, 1 Jun 2020 00:34:03 +0000 (20:34 -0400)] 
Support multiple dotted sections in mssql schema names

Refined the logic used by the SQL Server dialect to interpret multi-part
schema names that contain many dots, to not actually lose any dots if the
name does not have bracking or quoting used, and additionally to support a
"dbname" token that has many parts including that it may have multiple,
independently-bracketed sections.

This fix addresses #5364 to some degree but probably does not
resolve it fully.

References: #5364
Fixes: #5366
Change-Id: I460cd74ce443efb35fb63b6864f00c6d81422688
(cherry picked from commit 9aff0102813900fd7bc2120df5e1cfa169edb44f)

5 years agoAdd default expression to query_expression()
Haoyu Sun [Fri, 29 May 2020 18:31:07 +0000 (14:31 -0400)] 
Add default expression to query_expression()

Added a new parameter :paramref:`_orm.query_expression.default_expr` to the
:func:`_orm.query_expression` construct, which will be appled to queries
automatically if the :func:`_orm.with_expression` option is not used. Pull
request courtesy Haoyu Sun.

Fixes: #5198
Closes: #5354
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5354
Pull-request-sha: 57dd4922a3ae4e5fe56dcc541d85ce42256b38b9

Change-Id: I3400f2c00b58bf161f31c74c579feb9ac0f03356
(cherry picked from commit 9be0e9e5477cd6a494d9e3b3c13ceed1e50cc5a9)

5 years agoFix is_disconnect false positive for mssql+pyodbc
Gord Thompson [Fri, 29 May 2020 13:20:54 +0000 (07:20 -0600)] 
Fix is_disconnect false positive for mssql+pyodbc

Fixed an issue where the ``is_disconnect`` function in the SQL Server
pyodbc dialect was incorrectly reporting the disconnect state when the
exception messsage had a substring that matched a SQL Server ODBC error
code.

Fixes: #5359
Change-Id: I450c6818405a20f4daee20d58fce2d5ecb33e17f
(cherry picked from commit ddff320473dcbd3cc11d577715f96237276bc685)

5 years agoadd posargs to pep8
Mike Bayer [Fri, 29 May 2020 20:47:29 +0000 (16:47 -0400)] 
add posargs to pep8

we want to be able to specify --output-file

Change-Id: Ib4e992d47587385a50c35ca915bc5adcb2ca49fa
(cherry picked from commit 7ff6cf1eaa84f1387d60d4eb7ba752480a6bf567)

5 years agoMerge "SYBASE: Added offset support" into rel_1_3
mike bayer [Thu, 28 May 2020 16:42:38 +0000 (16:42 +0000)] 
Merge "SYBASE: Added offset support" into rel_1_3

5 years agoFix 'email_address' being typoed as 'email_addres' in two places
Mark Amery [Thu, 28 May 2020 12:37:24 +0000 (13:37 +0100)] 
Fix 'email_address' being typoed as 'email_addres' in two places

(cherry picked from commit 8a6e64323abeb9d08de3f68c63c6401ba1a5f847)

5 years agoRender table hints in generic SQL
Mike Bayer [Wed, 27 May 2020 14:18:33 +0000 (10:18 -0400)] 
Render table hints in generic SQL

Added :meth:`.Select.with_hint` output to the generic SQL string that is
produced when calling ``str()`` on a statement.  Previously, this clause
would be omitted under the assumption that it was dialect specific.
The hint text is presented within brackets to indicate the rendering
of such hints varies among backends.

Fixes: #5353
References: #4667
Change-Id: I01d97d6baa993e495519036ec7ecd5ae62856c16
(cherry picked from commit 7dc411dc63faf59b4e28fa0dea805887821d0d99)

5 years agoUpdates for examples/performance
Mike Bayer [Tue, 26 May 2020 03:24:05 +0000 (23:24 -0400)] 
Updates for examples/performance

added --sort option and also --raw option
from 6b3513f56c2a5d3ba45215b2438c47dba4336740

Change-Id: I42ef2135db08c87f33b51faed9c8bbff510c9e9b

5 years agoMerge "Add with_for_update mysql new functionalities" into rel_1_3
mike bayer [Sun, 24 May 2020 15:19:26 +0000 (15:19 +0000)] 
Merge "Add with_for_update mysql new functionalities" into rel_1_3

5 years agoAdd a docs link to the CockroachDB dialect
Rafi Shamim [Tue, 19 May 2020 17:42:49 +0000 (13:42 -0400)] 
Add a docs link to the CockroachDB dialect

This also increases the width of the table so that it's less likely the
whole table will need to be modified again in the future.

mike's cherry-pick also adds the firebird dialect
(cherry picked from commit 1d12bc1381c7ff6748eb63754405019f0ded29e4)

Change-Id: I85040e2c8f103340dc3f1844c5f8fb51cfb307dd

5 years agoSYBASE: Added offset support
snowman2 [Sat, 9 May 2020 13:17:21 +0000 (09:17 -0400)] 
SYBASE: Added offset support

Fixes: #5294
### Description
Fix for https://github.com/sqlalchemy/sqlalchemy/issues/5294#issue-610311455

I tested it against our database (Adaptive Server Enterprise/16.0 SP02) with `pyodbc+sybase`

### Checklist

This pull request is:

- [x] A short code fix for #5294
- [x] Added tests.

Closes: #5312
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5312
Pull-request-sha: f62c14825f2941fdd54ede17fd8d4f105a052e05

Change-Id: Ic716e17a6f654deef78781cefc3f16333cd725c3
(cherry picked from commit 360583a00abc0bf99a29a40b918bb5f741dc5198)

5 years agoAdd with_for_update mysql new functionalities
RobotScribe [Wed, 29 Apr 2020 19:22:59 +0000 (15:22 -0400)] 
Add with_for_update mysql new functionalities

Fixes: #4860
# Description
Add nowait, skip_lock, of arguments to for_update_clause for mysql

### Checklist

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: #5290
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5290
Pull-request-sha: 490e822e73e92ffe63cf45df9c49f3b31af1954d

Change-Id: Ibd2acc47b538c601c69c8fb954776035ecab4c6c
(cherry picked from commit 103260ddb476c5354b3201f92636c474f2a83c35)

5 years agoMerge "Correctly apply self_group in type_coerce element." into rel_1_3
mike bayer [Sat, 23 May 2020 21:21:59 +0000 (21:21 +0000)] 
Merge "Correctly apply self_group in type_coerce element." into rel_1_3

5 years agoMerge "Improve error message when using :meth:`_query.Query.filter_by` in a query...
mike bayer [Sat, 23 May 2020 21:12:07 +0000 (21:12 +0000)] 
Merge "Improve error message when using :meth:`_query.Query.filter_by` in a query where the first entity is not a mapped class." into rel_1_3

5 years agoMerge "Add note re: pymssql not in CI" into rel_1_3
mike bayer [Sat, 23 May 2020 21:11:08 +0000 (21:11 +0000)] 
Merge "Add note re: pymssql not in CI" into rel_1_3

5 years agoMerge "fix typo in reference documentation" into rel_1_3
mike bayer [Sat, 23 May 2020 21:10:41 +0000 (21:10 +0000)] 
Merge "fix typo in reference documentation" into rel_1_3

5 years agoStop converting mssql datetime.time parameters to datetime.datetime
Gord Thompson [Thu, 21 May 2020 22:20:48 +0000 (16:20 -0600)] 
Stop converting mssql datetime.time parameters to datetime.datetime

Fixes: #5339
Change-Id: Ida75422d8c3fdfc7adae68e547d88df49368a693
(cherry picked from commit 9a04c2f65754ac7bf93e0f58f68e59b41e43e67e)

5 years agofix typo in reference documentation
Federico Caselli [Fri, 22 May 2020 22:11:46 +0000 (00:11 +0200)] 
fix typo in reference documentation

Change-Id: I5720635863f0d8a8ebfa4ddc51008bb93c1067b4
(cherry picked from commit 2632a8db05d69607260d412852f7cc5c0ac0f368)

5 years agoCorrectly apply self_group in type_coerce element.
Federico Caselli [Fri, 22 May 2020 21:56:50 +0000 (23:56 +0200)] 
Correctly apply self_group in type_coerce element.

The type coerce element did not correctly apply grouping rules when using
in an expression

Fixes: #5344
Change-Id: Id67b0e60ac54f8992f931aaed62731672f60c96c
(cherry picked from commit d163088de1d68919b6811a25745d3becbbf5b069)

5 years agoMerge "Fix query string escaping in engine URLs" into rel_1_3
mike bayer [Fri, 22 May 2020 20:18:01 +0000 (20:18 +0000)] 
Merge "Fix query string escaping in engine URLs" into rel_1_3

5 years agoMerge "Don't emit pyodbc "no driver" warning for empty URL" into rel_1_3
mike bayer [Fri, 22 May 2020 20:12:54 +0000 (20:12 +0000)] 
Merge "Don't emit pyodbc "no driver" warning for empty URL" into rel_1_3

5 years agoCross reference do_connect() event w/ creator
Mike Bayer [Fri, 22 May 2020 20:04:17 +0000 (16:04 -0400)] 
Cross reference do_connect() event w/ creator

two questions today involving creator / do_connect,
do_connect is not well known enough, ensure docs are present
and prominent.

Change-Id: I85d518b9fc7b9b069a18010969abefa360134fe9
(cherry picked from commit 88ae6a6cdd9f37d65ea212736f1229bb62d677a9)

5 years agoDon't emit pyodbc "no driver" warning for empty URL
Mike Bayer [Fri, 22 May 2020 17:14:58 +0000 (13:14 -0400)] 
Don't emit pyodbc "no driver" warning for empty URL

Fixed an issue in the pyodbc connector such that a warning about pyodbc
"drivername" would be emitted when using a totally empty URL.  Empty URLs
are normal when producing a non-connected dialect object or when using the
"creator" argument to create_engine(). The warning now only emits if the
driver name is missing but other parameters are still present.

Fixes: #5346
Change-Id: I0ee6f5fd5af7faca63bf0d7034410942f40834a8
(cherry picked from commit 29534cf13939c7f7fe59399f12d50df2fcab7a38)

5 years agoFix query string escaping in engine URLs
Miguel Grinberg [Thu, 21 May 2020 09:54:47 +0000 (05:54 -0400)] 
Fix query string escaping in engine URLs

Fixed issue in :class:`.URL` object where stringifying the object
would not URL encode special characters, preventing the URL from being
re-consumable as a real URL.  Pull request courtesy Miguel Grinberg.

Fixes: #5341
Closes: #5342
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5342
Pull-request-sha: 362ca3398336a3a892e8020530f0c68d4f2d1d01

Change-Id: Ief6218122d1ec0c70479eb1a90e1c16433801924
(cherry picked from commit 2644693c0bf5b775f7a7283cdbf566a37872586f)

5 years agoTarget real pypi in the create wheel workflow
Federico Caselli [Wed, 20 May 2020 19:31:16 +0000 (21:31 +0200)] 
Target real pypi in the create wheel workflow

Change-Id: Ic764aae08b9d45011048f21c8ee992222c078bd2
(cherry picked from commit b67548ad788fc0eb8782dfd5a1d2a016dc5c7f78)

5 years agofix table.schema version to 1.3.18
Mike Bayer [Tue, 19 May 2020 22:55:16 +0000 (18:55 -0400)] 
fix table.schema version to 1.3.18

Fixes: #5338
Change-Id: I12ce8021f5627c306c768b74da991ef4af0a5b55
(cherry picked from commit 3d55263c92ee29a0257d823124c353a35246cf31)

5 years agoMerge "SQLite 3.31 added support for computed column." into rel_1_3
mike bayer [Tue, 19 May 2020 20:18:52 +0000 (20:18 +0000)] 
Merge "SQLite 3.31 added support for computed column." into rel_1_3

5 years agoMerge "Introduce :class:`.IdentityOptions` to store common parameters for sequences...
mike bayer [Tue, 19 May 2020 19:47:33 +0000 (19:47 +0000)] 
Merge "Introduce :class:`.IdentityOptions` to store common parameters for sequences and identity columns." into rel_1_3

5 years agoMerge "Use the same create-wheel workflow as in master" into rel_1_3
mike bayer [Tue, 19 May 2020 19:45:19 +0000 (19:45 +0000)] 
Merge "Use the same create-wheel workflow as in master" into rel_1_3

5 years agoSQLite 3.31 added support for computed column.
Federico Caselli [Fri, 1 May 2020 20:22:51 +0000 (22:22 +0200)] 
SQLite 3.31 added support for computed column.

This change enables their support in SQLAlchemy when targeting SQLite.

Fixes: #5297
Change-Id: Ia9f21a49e58fc977e3c669b8176036c95d93b9c8
(cherry picked from commit 40fdcec6dfd6444a85a15e42065ce3a20e82e99f)

5 years agoReword delete-orphan on many error message and document
Mike Bayer [Sat, 16 May 2020 17:05:00 +0000 (13:05 -0400)] 
Reword delete-orphan on many error message and document

For many years we have encountered users making use of the
"single_parent" flag in response to the error message for
"delete-orphan" expressing this as a means to cancel the current
error.   However, the actual issue here is usually a misuse
of the delete-orphan cascade setting.  Reword the error message to
be much more descriptive about what this means and add new
error link sections describing the situation in as much detail
as possible.

Fixes: #5329
Change-Id: I7ba710378b2935479ab22ff9a0a79c692dbf69a6
(cherry picked from commit 0d611b88911217727a174916b83e296e8c7105b1)

5 years agoAdd note re: pymssql not in CI
Gord Thompson [Sat, 16 May 2020 14:57:06 +0000 (08:57 -0600)] 
Add note re: pymssql not in CI

Change-Id: I45f78131ffe1881a3965e8aa41bbc46da7d43a5b
(cherry picked from commit 88bffda3feb83356f8bd6ce0443efea6ef725c24)

5 years agoIntroduce :class:`.IdentityOptions` to store common parameters for
Federico Caselli [Thu, 14 May 2020 20:57:56 +0000 (22:57 +0200)] 
Introduce :class:`.IdentityOptions` to store common parameters for
sequences and identity columns.

References: #5324
Change-Id: I72f7fc1a003456206b004d3d26306940f9c36414
(cherry picked from commit e1d8b15b636793a84f0d2baa7d6213ce7dec8080)

5 years agoMove supports_sane_rowcount_returning = False to dialect level
Gord Thompson [Mon, 11 May 2020 20:44:37 +0000 (14:44 -0600)] 
Move supports_sane_rowcount_returning = False to dialect level

Fixes: #5321
Change-Id: Id83e98e9013818424c133297a850746302633158
(cherry picked from commit cc97dade0de008ce923dbb94db21a8e1ccb5bb22)

5 years agoImprove error message when using :meth:`_query.Query.filter_by` in
Federico Caselli [Thu, 14 May 2020 19:51:59 +0000 (21:51 +0200)] 
Improve error message when using :meth:`_query.Query.filter_by` in
a query where the first entity is not a mapped class.

Fixes: #5260
Change-Id: I18cfccc0f3e587cb3df3e1f5f23b6885d5f2f466
(cherry picked from commit 8c10e29dc7aa2356d0f3f5110b2c9dade9d87096)

5 years agoAdd 'schema' parameter to table
Dylan Modesitt [Wed, 6 May 2020 18:17:23 +0000 (14:17 -0400)] 
Add 'schema' parameter to table

Added a "schema" parameter to the :func:`_expression.table` construct,
allowing ad-hoc table expressions to also include a schema name.
Pull request courtesy Dylan Modesitt.

Fixes: #5309
Closes: #5310
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5310
Pull-request-sha: ce85681050500186678131f948b6ea277a65dc17
Change-Id: I32015d593e1ee1121c7426fbffdcc565d025fad1
(cherry picked from commit 187a3a27cf8303ba332e011a482bd3b21cd3c01c)

5 years agoAdjust documentation wording for firebird and sybase
Gord Thompson [Fri, 15 May 2020 12:07:57 +0000 (06:07 -0600)] 
Adjust documentation wording for firebird and sybase

Change-Id: Ied2cdab1c2dbdee681a5500285a5bcdd4d589afa
(cherry picked from commit 1333f4a31e5870f70855cce310022e004580df40)

5 years agoUse the same create-wheel workflow as in master
Federico Caselli [Thu, 14 May 2020 19:15:56 +0000 (21:15 +0200)] 
Use the same create-wheel workflow as in master

Change-Id: If7cddde3b950978713e22888837163e730c1a938

5 years agoActively unset reset agent in discard transaction
Mike Bayer [Thu, 14 May 2020 14:51:29 +0000 (10:51 -0400)] 
Actively unset reset agent in discard transaction

The assumptions in _discard_transaction from
916e1fea25afcd07fa1d1d2f72043b372cd02223 were too narrow,
assuming that if the given transaction were not our
"current" one, that this would not be the reset agent.  however
as the legacy behvaior is that even a "nested" transaction gets
set as "self._transaction", this did not accommodate for the nested
transaction being thrown away.   We will attempt to refine all of this
logic in #5327 for 1.4 /master assuming this is feasible for the
full suite of current use cases.

Fixes: #5326
Change-Id: I6787e82c9e50c23317f87d0d094122c6a6f066da
(cherry picked from commit 79de84b25e87bbb7fa94f0dd513b4abc76e05a7e)

5 years agoRestore unreleased_XY directories
Mike Bayer [Thu, 14 May 2020 14:40:07 +0000 (10:40 -0400)] 
Restore unreleased_XY directories

these directories were removed in 4e5b7e6e62461d2685c1586dbb4cb1db88ff4ab0
which breaks the documentation builds.

Change-Id: I17aa66bf95c69a075a68e78245fad3bef85dc29e
(cherry picked from commit 6bd171cbc87db8ca55640bd7efd8c88a44d08808)

5 years agoVersion 1.3.18 placeholder
Mike Bayer [Wed, 13 May 2020 21:40:40 +0000 (17:40 -0400)] 
Version 1.3.18 placeholder

5 years ago- 1.3.17 rel_1_3_17
Mike Bayer [Wed, 13 May 2020 21:35:25 +0000 (17:35 -0400)] 
- 1.3.17

5 years agoMerge "Assert reset agent always set correctly and is active" into rel_1_3
mike bayer [Wed, 13 May 2020 21:34:26 +0000 (21:34 +0000)] 
Merge "Assert reset agent always set correctly and is active" into rel_1_3

5 years agoAssert reset agent always set correctly and is active
Mike Bayer [Wed, 13 May 2020 16:42:08 +0000 (12:42 -0400)] 
Assert reset agent always set correctly and is active

Fixed fairly critical issue where the DBAPI connection could be returned to
the connection pool while still in an un-rolled-back state. The reset agent
responsible for rolling back the connection could be corrupted in the case
that the transaction was "closed" without being rolled back or committed,
which can occur in some scenarios when using ORM sessions and emitting
.close() in a certain pattern involving savepoints.   The fix ensures that
the reset agent is always active.

Note for 1.3 the cherry-pick modifies the approach from master as
transaction handling has diverged.

Fixes: #5326
Change-Id: If056870ea70a2d9a1749768988d5e023f3061b31
(cherry picked from commit 4d161ac9c28986e1e022dfb93785767f28d6bfc8)

5 years agoMerge "Load external firebird or sybase dialect if available" into rel_1_3
mike bayer [Wed, 13 May 2020 17:16:25 +0000 (17:16 +0000)] 
Merge "Load external firebird or sybase dialect if available" into rel_1_3

5 years agoMerge "Fix typo in changelog of 5237" into rel_1_3
mike bayer [Tue, 12 May 2020 22:31:58 +0000 (22:31 +0000)] 
Merge "Fix typo in changelog of 5237" into rel_1_3

5 years agoFix typo in changelog of 5237
Federico Caselli [Tue, 12 May 2020 19:37:50 +0000 (21:37 +0200)] 
Fix typo in changelog of 5237

Change-Id: I9e526b133c130c1656fd09e5fecdc3a84c425d46
(cherry picked from commit 14e0ba214480df757de54b553c37a071d12c59d7)

5 years agoLoad external firebird or sybase dialect if available
Gord Thompson [Fri, 8 May 2020 11:52:02 +0000 (05:52 -0600)] 
Load external firebird or sybase dialect if available

Fixes: #5318
Extension of I1660abb11c02656fbf388f2f9c4257075111be58

Change-Id: I32b678430497327f9b08f821bd345a2557e34b1f
(cherry picked from commit 587f6c77153235e3defcc6b0b6598634e1ee2828)

5 years agoEnsure order in doctest of core/tutorial.rst
Federico Caselli [Sun, 10 May 2020 12:37:21 +0000 (14:37 +0200)] 
Ensure order in doctest of core/tutorial.rst

Fix doctest error caused by the missing order by clause in the
tests introduced in Ia1bbe3248b4f7c74fbee06fedf76a6ce94cd28a6

Change-Id: I55b45690879ebbaa57bc62765fcdab06f5e9c6f3
(cherry picked from commit 265ee8e39686b55f392feee94db72a7166f93d34)

5 years agoMerge "Use cx_oracle.LONG_STRING /LONG_BINARY for CLOB/BLOB" into rel_1_3
mike bayer [Sat, 9 May 2020 20:19:47 +0000 (20:19 +0000)] 
Merge "Use cx_oracle.LONG_STRING /LONG_BINARY for CLOB/BLOB" into rel_1_3

5 years agoMerge "Warn when sorted_tables is not actually sorting" into rel_1_3
mike bayer [Sat, 9 May 2020 13:57:31 +0000 (13:57 +0000)] 
Merge "Warn when sorted_tables is not actually sorting" into rel_1_3

5 years agoUse cx_oracle.LONG_STRING /LONG_BINARY for CLOB/BLOB
Mike Bayer [Thu, 7 May 2020 17:56:38 +0000 (13:56 -0400)] 
Use cx_oracle.LONG_STRING /LONG_BINARY for CLOB/BLOB

Changed the implementation of fetching CLOB and BLOB objects to use
cx_Oracle's native implementation which fetches CLOB/BLOB objects inline
with other result columns, rather than performing a separate fetch. As
always, this can be disabled by setting auto_convert_lobs to False.

As part of this change, the behavior of a CLOB that was given a blank
string on INSERT now returns None on SELECT, which is now consistent with
that of VARCHAR on Oracle.

Fixes: #5314
Change-Id: I7b46c91704b6f5d6c157e083505dac6e0cb3ef6e
(cherry picked from commit fb28e40b31797dc9ad72f11a8edd4f2eb555a36d)

5 years agoExpand CTE testing and begin to make this more prominent.
Mike Bayer [Fri, 8 May 2020 15:25:14 +0000 (11:25 -0400)] 
Expand CTE testing and begin to make this more prominent.

SQLite supports CTEs as do both the MariaDB and MySQL
databases now.  Expand test support and begin adding
new tutorial sections to make this concept more prominent.

Also fix some formatting issues in the tutorial, and start
moving more towards {opensql} - the "SQL" button thing
is cool but the tutorials mainly need to illustrate how
the SQL looks for things.  Screens are bigger now and
we likely should move away from the SQL button almost
entirely.

CTE for the tutorial needed zzzeeksphinx fix to recognize
"WITH" so bumping that to latest release number in git.

Change-Id: Ia1bbe3248b4f7c74fbee06fedf76a6ce94cd28a6
References: #5269
(cherry picked from commit e70e8a7f89f9b50d8f1e3161c44bbfcf64e8b9f3)

5 years agoWarn when sorted_tables is not actually sorting
Mike Bayer [Thu, 7 May 2020 21:13:35 +0000 (17:13 -0400)] 
Warn when sorted_tables is not actually sorting

A warning is emitted when making use of the :attr:`.MetaData.sorted_tables`
attribute as well as the :func:`_schema.sort_tables` function, and the
given tables cannot be correctly sorted due to a cyclic dependency between
foreign key constraints. In this case, the functions will no longer sort
the involved tables by foreign key, and a warning will be emitted. Other
tables that are not part of the cycle will still be returned in dependency
order. Previously, the sorted_table routines would return a collection that
would unconditionally omit all foreign keys when a cycle was detected, and
no warning was emitted.

Fixes: #5316
Change-Id: I14f72ccf39cb568bc77e8da16d0685718b2b9960
(cherry picked from commit 8782469b789585d3f0c3a642f0bb9519816f6b11)

5 years agoAdd sync_backref flag in a relationship
Federico Caselli [Wed, 22 Apr 2020 21:25:57 +0000 (23:25 +0200)] 
Add sync_backref flag in a relationship

Introduce :paramref:`_orm.relationship.sync_backref` flag in a relationship
to control if the synchronization events that mutate the in-Python
attributes are added.
This flag is implied in a ``viewonly=True`` relationship.
This supersedes the previous change #5149, that warned that ``viewonly=True``
relationship target of a back_populates or backref configuration would be
disallowed.

Fixes: #5237
Change-Id: I22c5ba28dcea22fc78a83e68e667140edffc515c
(cherry picked from commit 04c990a011db5629f1a53a8e5af2080180ac8ec3)

5 years agoMerge "Add warn_deprecated_limited feature" into rel_1_3
mike bayer [Wed, 6 May 2020 14:25:31 +0000 (14:25 +0000)] 
Merge "Add warn_deprecated_limited feature" into rel_1_3

5 years agoClarify create_engine encoding; update cx_Oracle
Mike Bayer [Wed, 6 May 2020 13:47:26 +0000 (09:47 -0400)] 
Clarify create_engine encoding; update cx_Oracle

The create_engine()->encoding parameter is mostly irrelevant
under Python 3.  make it clear this parameter is not generally
useful anymore and refer readers to the dialect documenation.

Update cx_Oracle documentation to feature many examples of
the encoding / nencoding parameters, remove extra detail that
is not generally useful and reorganize information into
more specific sections, de-emphasizing legacy / Python 2
specific sections.

Change-Id: I42dafb85de0a585c9e05e1e3d787d8d6bfa632c0
(cherry picked from commit 3ab5e3781b9f44d458cb6213e89f50d01ea167dd)