summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | updated historical terms with modern equivalentsjonathan vanasco2020-06-052-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### 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
* | | | | | Fix capitalization typos in engines.rstAbraham Sangha2020-06-081-2/+2
| |/ / / / |/| | | |
* | | | | Convert bulk update/delete to new execution modelMike Bayer2020-06-0631-507/+1123
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reorganizes the BulkUD model in sqlalchemy.orm.persistence to be based on the CompileState concept and to allow plain update() / delete() to be passed to session.execute() where the ORM synchronize session logic will take place. Also gets "synchronize_session='fetch'" working with horizontal sharding. Adding a few more result.scalar_one() types of methods as scalar_one() seems like what is normally desired. Fixes: #5160 Change-Id: I8001ebdad089da34119eb459709731ba6c0ba975
* | | | Fix connection string escaping for mssql+pyodbcGord Thompson2020-06-043-4/+12
|/ / / | | | | | | | | | | | | Fixes: #5373 Change-Id: Ia41e8f1ef8644c54d23ebfdf3f909c785adf0fb0
* | | Document that type_coerce does not currently imply parenthesizationMike Bayer2020-06-041-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Folds two identical exception handlers into a single one"mike bayer2020-06-032-8/+2
|\ \ \
| * | | Folds two identical exception handlers into a single oneElmer de Looff2020-06-032-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a `TODO` that searches for py2/3 compatible syntax to match multiple exception types. ### Description Merges the two exception clauses using the syntax that exists for both Python 2 and 3 as per the exception handling tutorials ([Python 2](https://docs.python.org/2/tutorial/errors.html#handling-exceptions), [Python 3](https://docs.python.org/3/tutorial/errors.html#handling-exceptions)) ### Checklist This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] 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: #5325 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5325 Pull-request-sha: d0835511e5509fb368a2193ebe4ecbbe3504b129 Change-Id: If3a8854e4de023e0ec68ae8649d24af9412f0717
* | | | Merge "Default create_constraint to False"mike bayer2020-06-038-46/+188
|\ \ \ \ | |_|_|/ |/| | |
| * | | Default create_constraint to FalseMike Bayer2020-06-038-46/+188
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The :paramref:`.Enum.create_constraint` and :paramref:`.Boolean.create_constraint` parameters now default to False, indicating when a so-called "non-native" version of these two datatypes is created, a CHECK constraint will not be generated by default. These CHECK constraints present schema-management maintenance complexities that should be opted in to, rather than being turned on by default. Fixes: #5367 Change-Id: I0a3fb608ce32143fa757546cc17ba2013e93272a
* | | | Inline a few ORM arguments, othersMike Bayer2020-06-036-48/+149
| |/ / |/| | | | | | | | | | | | | | small changes Change-Id: Id89a0651196c431d0aaf6935f5a4e7b12dd70c6c
* | | Merge "Add default expression to query_expression()"mike bayer2020-06-024-11/+71
|\ \ \ | |/ / |/| |
| * | Add default expression to query_expression()Haoyu Sun2020-06-014-11/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Refine IN and scalar subquery coercions"mike bayer2020-06-024-191/+325
|\ \ \
| * | | Refine IN and scalar subquery coercionsMike Bayer2020-06-014-191/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure IN emits a warning when it coerces a FromClause into a select(), however that it continues to allow the scalar_subquery() coercion to be automatic, particularly since it's not clear that "col IN (select)" is necessarily "scalar" in the case of tuples. Convert the "scalar_subquery()" warning emitted in other cases to be a warning, rather than a deprecation warning. I can't imagine taking this coercion out as it is intuitive and is always going to happen; we just would like to note that an implicit coercion is occurring. Fixes: #5369 Change-Id: I748f01f40bc85c64e2776f9b88ef35641fa8fb5c
* | | | Mark two tests as requiring boolean col expressionsMike Bayer2020-06-011-0/+2
|/ / / | | | | | | | | | | | | | | | fixes CI failures on mssql Change-Id: Ib9d3102bd7f8f4fb9ac5ac21abbb6a866e1f99cf
* | | Add a test / comment about test_orm_queryMike Bayer2020-06-011-0/+19
| | | | | | | | | | | | Change-Id: I8d78b3e75127141da177f711fd91216391a3c859
* | | Merge "Improve rendering of core statements w/ ORM elements"mike bayer2020-06-0135-927/+1495
|\ \ \
| * | | Improve rendering of core statements w/ ORM elementsMike Bayer2020-05-3135-927/+1495
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains a variety of ORM and expression layer tweaks to support ORM constructs in select() statements, without the 1.3.x requiremnt in Query that a full _compile_context() + new select() is needed in order to get a working statement object. Includes such tweaks as the ability to implement aliased class of an aliased class, as we are looking to fully support ACs against subqueries, as well as the ability to access anonymously-labeled ColumnProperty expressions within subqueries by naming the ".key" of the label after the property key. Some tuning to query.join() as well as ORMJoin internals to allow things to work more smoothly. Change-Id: Id810f485c5f7ed971529489b84694e02a3356d6d
* | | | Merge "Support multiple dotted sections in mssql schema names"mike bayer2020-06-014-58/+141
|\ \ \ \
| * | | | Support multiple dotted sections in mssql schema namesMike Bayer2020-06-014-58/+141
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Add support for "real" sequences in mssql"mike bayer2020-06-0125-224/+456
|\ \ \ \
| * | | | Add support for "real" sequences in mssqlGord Thompson2020-05-2925-224/+456
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added support for "CREATE SEQUENCE" and full :class:`.Sequence` support for Microsoft SQL Server. This removes the deprecated feature of using :class:`.Sequence` objects to manipulate IDENTITY characteristics which should now be performed using ``mssql_identity_start`` and ``mssql_identity_increment`` as documented at :ref:`mssql_identity`. The change includes a new parameter :paramref:`.Sequence.data_type` to accommodate SQL Server's choice of datatype, which for that backend includes INTEGER and BIGINT. The default starting value for SQL Server's version of :class:`.Sequence` has been set at 1; this default is now emitted within the CREATE SEQUENCE DDL for all backends. Fixes: #4235 Fixes: #4633 Change-Id: I6aa55c441e8146c2f002e2e201a7f645e667b916
* | | | | Fix is_disconnect false positive for mssql+pyodbcGord Thompson2020-06-013-5/+54
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Remove loader option cycle"mike bayer2020-05-295-101/+99
|\ \ \ \ | |_|/ / |/| | |
| * | | Remove loader option cycleMike Bayer2020-05-295-101/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | removed a reference cycle set up by loader options due to the attribute dictionary containing Load objects that reference that dictionary. Change-Id: Ie3159a084f819ae44ca4992b0dbe094fb69b2fa7
* | | | add posargs to pep8Mike Bayer2020-05-291-2/+2
| |/ / |/| | | | | | | | | | | | | | we want to be able to specify --output-file Change-Id: Ib4e992d47587385a50c35ca915bc5adcb2ca49fa
* | | Add full profile sort, dumping to profile resultsMike Bayer2020-05-282-2/+17
|/ / | | | | | | Change-Id: Ib256ae34de15d29ee9a48e3be86073610f8d1a65
* | Merge "callcount reductions and refinement for cached queries"mike bayer2020-05-2835-1266/+1659
|\ \
| * | callcount reductions and refinement for cached queriesMike Bayer2020-05-2835-1266/+1659
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes that we've removed the "_orm_query" attribute from compile state as well as query context. The attribute created reference cycles and also added method call overhead. As part of this change, the interface for ORMExecuteState changes a bit, as well as the interface for the horizontal sharding extension which now deprecates the "query_chooser" callable in favor of "execute_chooser", which receives the contextual object. This will also work more nicely when we implement the new execution path for bulk updates and deletes. Pre-merge execution options for statement, connection, arguments all up front in Connection. that way they can be passed to the before_execute / after_execute events, and the ExecutionContext doesn't have to merge as second time. Core execute is pretty close to 1.3 now. baked wasn't using the new one()/first()/one_or_none() methods, fixed that. Convert non-buffered cursor strategy to be a stateless singleton. inline all the paths by which the strategy gets chosen, oracle and SQL Server dialects make use of the already-invoked post_exec() hook to establish the alternate strategies, and this is actually much nicer than it was before. Add caching to mapper instance processor for getters. Identified a reference cycle per query that was showing up as a lot of gc cleanup, fixed that. After all that, performance not budging much. Even test_baked_query now runs with significantly fewer function calls than 1.3, still 40% slower. Basically something about the new patterns just makes this slower and while I've walked a whole bunch of them back, it hardly makes a dent. that said, the performance issues are relatively small, in the 20-40% time increase range, and the new caching feature does provide for regular ORM and Core queries that are cached, and they are faster than non-cached. Change-Id: I7b0b0d8ca550c05f79e82f75cd8eff0bbfade053
* | | Merge "SYBASE: Added offset support"mike bayer2020-05-283-21/+29
|\ \ \
| * | | SYBASE: Added offset supportsnowman22020-05-243-21/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Fix 'email_address' being typoed as 'email_addres' in two placesMark Amery2020-05-280-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Description Fixes a typo that coincidentally occurs in a couple of different places - once in the docs, and another time in a test, where it was presumably neutering one of the test's assertions by making it always pass. ### 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: #5358 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5358 Pull-request-sha: 8a6e64323abeb9d08de3f68c63c6401ba1a5f847 Change-Id: I667657ee2d1d67b142f025257da7953a51c2ab7f
* | | | Merge remote-tracking branch 'origin/pr/5358'Mike Bayer2020-05-282-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | Change-Id: Ibe7c41a7f3443eeef1eb3e8666f631bac05509fc
| * | | | Fix 'email_address' being typoed as 'email_addres' in two placesMark Amery2020-05-282-2/+2
| | |/ / | |/| |
* | | | Render table hints in generic SQLMike Bayer2020-05-273-0/+48
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Revert 903b18828461bb8cb8dca4acc56809b3df2b14d5Mike Bayer2020-05-253-90/+77
| | | | | | | | | | | | | | | | | | This was accidentally pushed just now. Change-Id: I4da4151c4a81e5cf72146f8dcab3537301ccaae9
* | | Updates for examples / performanceMike Bayer2020-05-252-23/+21
| | | | | | | | | | | | Change-Id: I55fc60258075f6f3efb7f738b900f60b2d2994c4
* | | Small callcount reductions and refinement for cached queriesMike Bayer2020-05-253-77/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | baked wasn't using the new one()/first()/one_or_none() methods, fixed that. loading._instance_processor() can skip setting up the quick populators every time because it can cache the getters. Callcounts have gone below what 1.3 does for the test_baked_query performance suite, however runtime for continued inexplicable reasons has not :(. still suspecting the result tuples but this seems so hard to believe. Change-Id: Ifbca04834d27350e0fa82cb8512e66112abc8729
* | | Convert execution to move through SessionMike Bayer2020-05-2571-1524/+3208
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch replaces the ORM execution flow with a single pathway through Session.execute() for all queries, including Core and ORM. Currently included is full support for ORM Query, Query.from_statement(), select(), as well as the baked query and horizontal shard systems. Initial changes have also been made to the dogpile caching example, which like baked query makes use of a new ORM-specific execution hook that replaces the use of both QueryEvents.before_compile() as well as Query._execute_and_instances() as the central ORM interception hooks. select() and Query() constructs alike can be passed to Session.execute() where they will return ORM results in a Results object. This API is currently used internally by Query. Full support for Session.execute()->results to behave in a fully 2.0 fashion will be in later changesets. bulk update/delete with ORM support will also be delivered via the update() and delete() constructs, however these have not yet been adapted to the new system and may follow in a subsequent update. Performance is also beginning to lag as of this commit and some previous ones. It is hoped that a few central functions such as the coercions functions can be rewritten in C to re-gain performance. Additionally, query caching is now available and some subsequent patches will attempt to cache more of the per-execution work from the ORM layer, e.g. column getters and adapters. This patch also contains initial "turn on" of the caching system enginewide via the query_cache_size parameter to create_engine(). Still defaulting at zero for "no caching". The caching system still needs adjustments in order to gain adequate performance. Change-Id: I047a7ebb26aa85dc01f6789fac2bff561dcd555d
* | | Unify Query and select() , move all processing to compile phaseMike Bayer2020-05-2478-3660/+8092
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert Query to do virtually all compile state computation in the _compile_context() phase, and organize it all such that a plain select() construct may also be used as the source of information in order to generate ORM query state. This makes it such that Query is not needed except for its additional methods like from_self() which are all to be deprecated. The construction of ORM state will occur beyond the caching boundary when the new execution model is integrated. future select() gains a working join() and filter_by() method. as we continue to rebase and merge each commit in the steps, callcounts continue to bump around. will have to look at the final result when it's all in. References: #5159 References: #4705 References: #4639 References: #4871 References: #5010 Change-Id: I19e05b3424b07114cce6c439b05198ac47f7ac10
* | Merge "inline one_or_none"mike bayer2020-05-245-45/+160
|\ \
| * | inline one_or_noneMike Bayer2020-05-245-45/+160
| |/ | | | | | | | | | | | | Remove a bunch of unnecessary functions for this case. add test coverage to ensure uniqueness logic works. Change-Id: I2e6232c5667a3277b0ec8d7e47085a267f23d75f
* | Add a docs link to the CockroachDB dialectRafi Shamim2020-05-241-41/+44
|/ | | | | 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.
* Avoid proxy functions in row functionsFederico Caselli2020-05-236-308/+369
| | | | | | | | | | | This streamlines a bit for non-C implementations, however also adds and tests behavioral contracts that mappings should not allow integer or slice access and should behave like a Python mapping in that it raises KeyError for an integer and TypeError for a slice. Py3/Py2/C/noC :) References: #5340 Change-Id: Id3cef452dc8a526b8371c90c5ca2bbb240b25c26
* Merge "Add python 3.8 profiles; remove zoomark tests"mike bayer2020-05-235-1614/+337
|\
| * Add python 3.8 profiles; remove zoomark testsFederico Caselli2020-05-235-1614/+337
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The zoomark tests have served us well for many years. At this point, they have been using a very antiquated calling style for many years and are no longer where we catch performance issues. The performance suite now has a large number of individual tests that catch issues very specifically and additionally record just one performance count per test. This also allows us to remove the "replay" fixtures that were not used for anything else. Fixes: #5347 Change-Id: I0a8d078e7b7240602f4f3f7068f231e98a40f17e
* | Merge "Correctly apply self_group in type_coerce element."mike bayer2020-05-233-6/+25
|\ \
| * | Correctly apply self_group in type_coerce element.Federico Caselli2020-05-223-6/+25
| |/ | | | | | | | | | | | | | | The type coerce element did not correctly apply grouping rules when using in an expression Fixes: #5344 Change-Id: Id67b0e60ac54f8992f931aaed62731672f60c96c
* | Merge "Add with_for_update mysql new functionalities"mike bayer2020-05-237-7/+319
|\ \
| * | Add with_for_update mysql new functionalitiesRobotScribe2020-05-157-7/+319
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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