]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
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 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)

5 years agoAdd warn_deprecated_limited feature
Gord Thompson [Fri, 24 Apr 2020 12:23:19 +0000 (06:23 -0600)] 
Add warn_deprecated_limited feature

Fixes: #5268
Change-Id: I2f976048af4f8d6dd03a14efa31d179bd7324ba6
(cherry picked from commit 7baf42883f177a6f666a1cb550f4357aa7606a25)

5 years agoConsider aliased=True, from_joinpoint as legacy
Mike Bayer [Mon, 4 May 2020 19:48:48 +0000 (15:48 -0400)] 
Consider aliased=True, from_joinpoint as legacy

For a 1.4 / 1.3 merge, rewrite the documentation for
Query.join() to indicate calling forms that are now considered
legacy, including the use of strings in join(), sending a
series of join paths in one call, and using the aliased=True
flag.   update the elementtree examples as well to use aliased()
(they are much simpler to understand this way too) and update
other links.

Also improve docs for aliased() and some other ORM targets
such as PropComparator.

Change-Id: I636e3a9130dc5509e51c2cf60a52f38fcadffbc6
References: #4705
(cherry picked from commit 9f6b67a37e820b9a5be54301d08f20161bd20ee8)

5 years agoMerge "Don't apply sets or similar to objects in IdentitySet" into rel_1_3
mike bayer [Mon, 4 May 2020 17:10:13 +0000 (17:10 +0000)] 
Merge "Don't apply sets or similar to objects in IdentitySet" into rel_1_3

5 years agoBaked query needs to spoil fully on uncachable option
Mike Bayer [Sun, 3 May 2020 23:35:54 +0000 (19:35 -0400)] 
Baked query needs to spoil fully on uncachable option

Fixed issue in the area of where loader options such as selectinload()
interact with the baked query system, such that the caching of a query is
not supposed to occur if the loader options themselves have elements such
as with_polymorphic() objects in them that currently are not
cache-compatible.  The baked loader could sometimes not fully invalidate
itself in these some of these scenarios leading to missed eager loads.

Fixes: #5303
Change-Id: Iecf847204a619694d89297f83b63b613ef9767de
(cherry picked from commit dd244758a218201e6b38c44f7a9779a40177742b)

5 years agoDon't apply sets or similar to objects in IdentitySet
Mike Bayer [Mon, 4 May 2020 00:27:24 +0000 (20:27 -0400)] 
Don't apply sets or similar to objects in IdentitySet

Modified the internal "identity set" implementation, which is a set that
hashes objects on their id() rather than their hash values, to not actually
call the ``__hash__()`` method of the objects, which are typically
user-mapped objects.  Some methods were calling this method as a side
effect of the implementation.

Fixes: #5304
Change-Id: I0ed8762f47622215a54dcad9f210377b1becf8e8
(cherry picked from commit 35552e88ca798b809c7391bae11890c1557a3dd2)

5 years agoMerge "Capitalize documentation for relationship params" into rel_1_3
mike bayer [Sat, 2 May 2020 03:34:17 +0000 (03:34 +0000)] 
Merge "Capitalize documentation for relationship params" into rel_1_3

5 years agoHandle non-string, non column expression in index for deferred attach
Mike Bayer [Sat, 2 May 2020 00:30:18 +0000 (20:30 -0400)] 
Handle non-string, non column expression in index for deferred attach

Fixed issue where an :class:`.Index` that is deferred in being associated
with a table, such as as when it contains a :class:`.Column` that is not
associated with any :class:`.Table` yet,  would fail to attach correctly if
it also contained a non table-oriented expession.

Fixes: #5298
Change-Id: I0111c400f6bd4a9f31bf00a9957816c7a3fac783
(cherry picked from commit 45a334e38c1baab34d3195c899cb9ca617fb52a7)

5 years agoMerge "Enable loading of external Firebird dialect, if available" into rel_1_3
Gord Thompson [Fri, 1 May 2020 16:24:33 +0000 (16:24 +0000)] 
Merge "Enable loading of external Firebird dialect, if available" into rel_1_3

5 years agorepair test_fetch_results
Mike Bayer [Thu, 30 Apr 2020 19:06:03 +0000 (15:06 -0400)] 
repair test_fetch_results

this profiling test was not actually loading the related
objects.

Change-Id: I9d18a44f50f72f6653f736708829365eb561160e
(cherry picked from commit ebe558f956fd63d47e23e3bb56070edab1079e96)
(cherry picked from commit 397cef1f049096de173f9a629b9ab0cfaf25b739)

5 years agoCapitalize documentation for relationship params
Federico Caselli [Tue, 28 Apr 2020 20:28:33 +0000 (22:28 +0200)] 
Capitalize documentation for relationship params

Change-Id: Iec1f0afcc57177a7463d8238f1c5d6bb8b86bbb3
(cherry picked from commit 0c9812e50568fdfb5649e8449fcb877567f990e8)

5 years agoEnable loading of external Firebird dialect, if available
Gord Thompson [Fri, 24 Apr 2020 15:05:47 +0000 (09:05 -0600)] 
Enable loading of external Firebird dialect, if available

Fixes: #5278
Change-Id: I1660abb11c02656fbf388f2f9c4257075111be58
(cherry picked from commit 8c5aa7d3e0f853e30249cf1ad9e1f7e7d426a245)

5 years agoAlias the onclause if ORM join is to same polymorphic selectable
Mike Bayer [Mon, 27 Apr 2020 20:51:43 +0000 (16:51 -0400)] 
Alias the onclause if ORM join is to same polymorphic selectable

Fixed bug where using :func:`.with_polymorphic` as the target of a join via
:meth:`.RelationshipComparator.of_type` on a mapper that already has a
subquery-based with_polymorphic setting that's equivalent to the one
requested would not correctly alias the ON clause in the join.

Fixes: #5288
Change-Id: I0212a990ee67a344c87fe21833bf47fdb72ca0cc
(cherry picked from commit 483a644959f396e3abdcb8f0f373936569958970)

5 years agoFix regression when reflecting tables in MSSQL
Federico Caselli [Thu, 16 Apr 2020 21:01:03 +0000 (23:01 +0200)] 
Fix regression when reflecting tables in MSSQL

Fix a regression introduced by the reflection of computed column in
MSSQL when using SQL server versions before 2012, which does not support
the ``concat`` function and when using the legacy TDS version 4.2.
The dialect will try to detect the protocol version of first connect
and run in compatibility mode if it cannot detect it.

Fixes: #5255
Fixes: #5271
Change-Id: I7b33f7889ac0784cd8ae5385cbd50bc8c862398a
(cherry picked from commit 50d283af1a254ef981ac9a2466399b4828de0117)

5 years agoMerge "Add ColumnProperty.Comparator.expressions" into rel_1_3
mike bayer [Tue, 21 Apr 2020 13:40:23 +0000 (13:40 +0000)] 
Merge "Add ColumnProperty.Comparator.expressions" into rel_1_3

5 years agoFix typo in pymssql documentation; minor clarification
Gord Thompson [Mon, 20 Apr 2020 19:16:20 +0000 (13:16 -0600)] 
Fix typo in pymssql documentation; minor clarification

Change-Id: I4aaf0627d2f1ccae82c2eb41db9ec219d73ce4ea
(cherry picked from commit 469e786c9d77e182ef403ba18e7f19b3f58fe3bf)

5 years agoAdd ColumnProperty.Comparator.expressions
Mike Bayer [Mon, 20 Apr 2020 16:24:40 +0000 (12:24 -0400)] 
Add ColumnProperty.Comparator.expressions

Added an accessor :attr:`.ColumnProperty.Comparator.expressions` which
provides access to the group of columns mapped under a multi-column
:class:`.ColumnProperty` attribute.

Fixes: #5262
Change-Id: I44cf53ff0e6cf76a0c90eee4638ca96da3df8088
(cherry picked from commit d9d724267afe867984a23abaa87f62e15786005f)

5 years agoSupport `ARRAY` of `Enum`, `JSON` or `JSONB`
Federico Caselli [Sun, 19 Apr 2020 18:09:39 +0000 (20:09 +0200)] 
Support `ARRAY` of `Enum`, `JSON` or `JSONB`

Added support for columns or type :class:`.ARRAY` of :class:`.Enum`,
:class:`.JSON` or :class:`_postgresql.JSONB` in PostgreSQL.
Previously a workaround was required in these use cases.
Raise an explicit :class:`.exc.CompileError` when adding a table with a
column of type :class:`.ARRAY` of :class:`.Enum` configured with
:paramref:`.Enum.native_enum` set to ``False`` when
:paramref:`.Enum.create_constraint` is not set to ``False``

Fixes: #5265
Fixes: #5266
Change-Id: I83a2d20a599232b7066d0839f3e55ff8b78cd8fc
(cherry picked from commit aaec1bdedfc73ead3aef3a3e4d835a8df339e2dd)

5 years agoMerge "Raise informative error when non-object m2o comparison used" into rel_1_3
mike bayer [Mon, 20 Apr 2020 15:31:27 +0000 (15:31 +0000)] 
Merge "Raise informative error when non-object m2o comparison used" into rel_1_3

5 years agofix changelog
Federico Caselli [Fri, 10 Apr 2020 20:54:13 +0000 (22:54 +0200)] 
fix changelog

(cherry picked from commit ad7e9a65d4e8359aef323aa1e23db76fc86c4aeb)

5 years agoRename py.test to pytest
Gord Thompson [Thu, 16 Apr 2020 22:06:36 +0000 (16:06 -0600)] 
Rename py.test to pytest

Change-Id: I431e1ef41e26d490343204a75a5c097768749768
(cherry picked from commit 405fc9717048b0adc852a72da540048df7a8142a)

5 years agoAdd @requirements.schemas to test_create_table_schema
Gord Thompson [Sat, 18 Apr 2020 14:41:04 +0000 (08:41 -0600)] 
Add @requirements.schemas to test_create_table_schema

Prevent test_create_table_schema from failing for databases that do not support schemas.

Change-Id: I0f5f129c313ee6023be2e6d84610355afc48c05c
(cherry picked from commit 6e208823a66723c842975e0b75ec0e8b34ce0d2f)

5 years agoRaise informative error when non-object m2o comparison used
Mike Bayer [Sun, 19 Apr 2020 20:52:54 +0000 (16:52 -0400)] 
Raise informative error when non-object m2o comparison used

An informative error message is raised when an ORM many-to-one comparison
is attempted against an object that is not an actual mapped instance.
Comparisons such as those to scalar subqueries aren't supported;
generalized comparison with subqueries is better achieved using
:meth:`~.RelationshipProperty.Comparator.has`.

Fixes: #5269
Change-Id: I2e23178eb59728c39241a46bfa7411239a87492e
(cherry picked from commit 430ce5eab26d46301ae741f9068f13ba09907d8e)

5 years agoMerge "Pass connection to TablesTest.insert_data()" into rel_1_3
mike bayer [Wed, 15 Apr 2020 18:31:55 +0000 (18:31 +0000)] 
Merge "Pass connection to TablesTest.insert_data()" into rel_1_3

5 years agoPass connection to TablesTest.insert_data()
Mike Bayer [Tue, 14 Apr 2020 19:30:28 +0000 (15:30 -0400)] 
Pass connection to TablesTest.insert_data()

towards the goal of reducing verbosity and repetition
in test fixtures as well as that we are moving to
connection only for execution, move the insert_data()
classmethod to accept a connection and adjust all
fixtures to use it.

Change-Id: I3bf534acca0d5f4cda1d4da8ae91f1155b829b09
(cherry picked from commit 5c010c097352c783729e210018b95130ef94a926)

5 years agoSet up absolute references for create_engine and related
Mike Bayer [Tue, 14 Apr 2020 20:45:15 +0000 (16:45 -0400)] 
Set up absolute references for create_engine and related

includes more replacements for create_engine(), Connection

Change-Id: I680c02e90b9ece53e52ab1d66fd7d20b47c7df16

5 years agoMerge "Run search and replace of symbolic module names" into rel_1_3
mike bayer [Tue, 14 Apr 2020 20:01:36 +0000 (20:01 +0000)] 
Merge "Run search and replace of symbolic module names" into rel_1_3

5 years agoAdd github workflow to generate wheel running after a release has beed created
Federico Caselli [Wed, 8 Apr 2020 20:17:42 +0000 (22:17 +0200)] 
Add github workflow to generate wheel running after a release has beed created

Change-Id: I916491f8f6bdbf7de7970a0ad4b24b9965003786
(cherry picked from commit bf11ec3a10918bac956731430023eb308ee19c51)

5 years agoRun search and replace of symbolic module names
Mike Bayer [Tue, 14 Apr 2020 17:21:22 +0000 (13:21 -0400)] 
Run search and replace of symbolic module names

Replaces a wide array of Sphinx-relative doc references
with an abbreviated absolute form now supported by
zzzeeksphinx.

Change-Id: I94bffcc3f37885ffdde6238767224296339698a2

5 years agoMerge "Enable zzzeeksphinx module prefixes" into rel_1_3
mike bayer [Tue, 14 Apr 2020 17:04:43 +0000 (17:04 +0000)] 
Merge "Enable zzzeeksphinx module prefixes" into rel_1_3

5 years agoEnable zzzeeksphinx module prefixes
Mike Bayer [Sun, 12 Apr 2020 19:18:02 +0000 (15:18 -0400)] 
Enable zzzeeksphinx module prefixes

zzzeeksphinx 1.1.2 in git can now convert short
prefix names in a configured lookup to fully qualified module
names, so that
we can have succinct and portable pyrefs
that still resolve absolutely.
It also includes a formatter that will format all pyrefs
in a fully consistent way regardless of the package path,
by unconditionally removing all package tokens but always
leaving class names in place including for methods, which
means we no longer have to deal with tildes in pyrefs.

The most immediate goal of the absolute prefixes is
that we have lots of
"ambiguous" names that appear in muliple places, like select(),
ARRAY, ENUM etc.   With the incoming future packages there
is going to be lots of name overlap so it is necessary
that all names eventually use absolute package paths
when Sphinx receives them.

In multiple stages, pyrefs will be converted using the
zzzeeksphinx tools/fix_xrefs.py tool so that doclinks can
be made absolute using symbolic prefixes.

For this review, the actual search and replace of symbols
is not performed, instead some general cleanup to prepare
the docs as well as a lookup file used by the tool
to do the conversion.   this relatively small patch will
be backported
with appropriate changes to 1.3, 1.2, 1.1 and the tool
can then be run on each branch individually.  We are shooting
for almost no warnings at all for master (still a handful
I can't figure out which don't seem to have any impact)
, very few for 1.3,
and for 1.2 / 1.1 we hope for a significant reduction
in warnings.

Overall for all versions pyrefs should
always point to the correct target, if they are in fact
hyperlinked.  it's better for a ref to go nowhere and
be plain text than go to the wrong thing.  Right now,
hundreds of API links are pointing to the wrong thing
as they are ambiguous names such as refresh(), insert(),
update(), select(), join(), JSON etc. and Sphinx sends these all
to essesntially random destinations among as many as five
or six possible choices per symbol.  A shorthand system
that allows us to use absolute refs without having
to type out a full blown absoulte module is the only
way this is going to work, and we should ultimately
seek to abandon any use of prefix dot for lookups.  Everything
should be on an underscore token so at the very least the module
spaces can be reorganized without having to search and replace
the entire documentation every time.

Change-Id: I484a7329034af275fcdb322b62b6255dfeea9151
(cherry picked from commit d8d755ad619e2ee78f2c7cb60ae9a1feee4c6d76)

5 years agoAdjust changelog files for removed directories
Mike Bayer [Mon, 13 Apr 2020 22:39:47 +0000 (18:39 -0400)] 
Adjust changelog files for removed directories

unreleased_11 and unreleased_12 are gone so remove these

also there's no place for the 4065 file to go, this is an old
and very small change and it looks like the file was not published in any
case, so just remove it.

Change-Id: I2b890ac4c7142e7b4462a7f45d7caa856edf3d4f
(cherry picked from commit b289fb032ead703eb131ad1b0d0e0dcba8617ca3)

5 years agoSquashed commit of the following:
Mike Bayer [Mon, 13 Apr 2020 22:29:46 +0000 (18:29 -0400)] 
Squashed commit of the following:

commit 571da00f2c6fe905591b398a1e2fbc8ee2d05873
Author: jonathan vanasco <jonathan@2xlp.com>
Date:   Mon Apr 13 18:16:23 2020 -0400

    more examples, as suggested

commit c7b154eaf47719923c41498453571e04b6de1141
Author: jonathan vanasco <jonathan@2xlp.com>
Date:   Mon Apr 13 17:24:47 2020 -0400

    consolidating README

commit ff294507b664e9c414944a7509a0f71338957fbf
Author: jonathan vanasco <jonathan@2xlp.com>
Date:   Mon Apr 6 14:59:45 2020 -0400

    adding example readme

plus some mike changes

Change-Id: I09a11164df034ddcfe7c4e7d52308ea0b1ec509c
(cherry picked from commit 4e5b7e6e62461d2685c1586dbb4cb1db88ff4ab0)

5 years agoAdd missing definitions to glossary
Mike Bayer [Mon, 13 Apr 2020 19:24:23 +0000 (15:24 -0400)] 
Add missing definitions to glossary

improve formatting

Change-Id: Iea3b72187d7c8020e18babb72a53c39c5aeec68c
(cherry picked from commit 1b1fe518512441959f4ac9c9b715271e2b6d7977)

5 years agoMerge "A few adjustments for tests to succeed on python 3.5" into rel_1_3
mike bayer [Mon, 13 Apr 2020 15:29:36 +0000 (15:29 +0000)] 
Merge "A few adjustments for tests to succeed on python 3.5" into rel_1_3

5 years agoMerge "Add ``comment`` attribute to :class:`.Column` ``__repr__`` method." into rel_1_3
mike bayer [Mon, 13 Apr 2020 15:28:19 +0000 (15:28 +0000)] 
Merge "Add ``comment`` attribute to :class:`.Column` ``__repr__`` method." into rel_1_3

5 years agoA few adjustments for tests to succeed on python 3.5
Federico Caselli [Wed, 8 Apr 2020 18:54:26 +0000 (20:54 +0200)] 
A few adjustments for tests to succeed on python 3.5

Ported from Change-Id: Ia93ee1cb5c52e51e72eb0a24c100421c5157d04b

Change-Id: Ia1086d3013b74ef0b2b69381483a9501288853a9

5 years agoMerge "Use define_tables for IsOrIsNotDistinctFromTest" into rel_1_3
mike bayer [Mon, 13 Apr 2020 01:34:04 +0000 (01:34 +0000)] 
Merge "Use define_tables for IsOrIsNotDistinctFromTest" into rel_1_3

5 years agoAdd ``comment`` attribute to :class:`.Column` ``__repr__`` method.
Federico Caselli [Sat, 11 Apr 2020 18:52:12 +0000 (20:52 +0200)] 
Add ``comment`` attribute to :class:`.Column` ``__repr__`` method.

Fixes #4138

Change-Id: Iad3604ce054aaac36fc93d623ae5058852875d97