summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Deprecate bound metadataMike Bayer2020-10-122-2/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The :paramref:`_schema.MetaData.bind` argument as well as the overall concept of "bound metadata" is deprecated in SQLAlchemy 1.4 and will be removed in SQLAlchemy 2.0. The parameter as well as related functions now emit a :class:`_exc.RemovedIn20Warning` when :ref:`deprecation_20_mode` is in use. Added new parameter :paramref:`_automap.AutomapBase.prepare.autoload_with` which supersedes :paramref:`_automap.AutomapBase.prepare.reflect` and :paramref:`_automap.AutomapBase.prepare.engine`. Fixes: #4634 Fixes: #5142 Change-Id: Iaabf9b481931e2fb68b97b5954c32e65772a298e
* | | Deprecate duplicated column names in Table definitionMike Bayer2020-10-123-35/+69
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | The :class:`_schema.Table` class now raises a deprecation warning when columns with the same name are defined. To replace a column a new parameter :paramref:`_schema.Table.append_column.replace_existing` was added to the :meth:`_schema.Table.append_column` method. The :meth:`_expression.ColumnCollection.contains_column` will now raises an error when called with a string, suggesting the caller to use ``in`` instead. Co-authored-by: Federico Caselli <cfederico87@gmail.com> Change-Id: I1d58c8ebe081079cb669e7ead60886ffc1b1a7f5
* | Repair reduction in OverMike Bayer2020-10-121-0/+9
|/ | | | | | | | Fixed issue where a plain pickle dumps call of the :class:`_sql.Over` construct didn't work. Fixes: #5644 Change-Id: I4b07f74ecd5d52f0794128585367012200a38a36
* Address minor comments from previous changesFederico Caselli2020-10-061-1/+1
| | | | | | | Change how pypy is detected. From I0952e54ed9af2952ea340be1945311376ffc1ad2 Fix typos. From Ibb5871a457c0555f82b37e354e7787d15575f1f7 Change-Id: I9657e602267590f10a74df27a84e4292da94c30a
* Merge "Fetch first support"mike bayer2020-10-052-27/+123
|\
| * Fetch first supportFederico Caselli2020-10-022-27/+123
| | | | | | | | | | | | | | | | | | Add support to ``FETCH {FIRST | NEXT} [ count ] {ROW | ROWS} {ONLY | WITH TIES}`` in the select for the supported backends, currently PostgreSQL, Oracle and MSSQL. Fixes: #5576 Change-Id: Ibb5871a457c0555f82b37e354e7787d15575f1f7
* | Merge "Improve some documentations"mike bayer2020-10-051-1/+1
|\ \ | |/ |/|
| * Improve some documentationsFederico Caselli2020-09-291-1/+1
| | | | | | | | Change-Id: Ibcb0da3166b94aa58fa92d544c3e5cf75844546e
* | raise on lower-case column shared to multiple tablesMike Bayer2020-09-301-0/+7
| | | | | | | | | | | | | | | | | | | | Fixed bug where an error was not raised for lower-case :func:`_column` added to lower-case :func:`_table` object. This now raises :class:`_exc.ArgumentError` which has always been the case for upper-case :class:`_schema.Column` and :class:`_schema.Table`. Fixes: #5618 Change-Id: Ifcbdf27c022fd2996a5b99559df71fc1c1e0f19c
* | Scan for tables without relying upon whereclauseMike Bayer2020-09-292-1/+18
|/ | | | | | | | | | | | Fixed bug where an UPDATE statement against a JOIN using MySQL multi-table format would fail to include the table prefix for the target table if the statement had no WHERE clause, as only the WHERE clause were scanned to detect a "multi table update" at that particular point. The target is now also scanned if it's a JOIN to get the leftmost table as the primary table and the additional entries as additional FROM entries. Fixes: #5617 Change-Id: I26d74afebe06e28af28acf960258f170a1627823
* upgrade to black 20.8b1Mike Bayer2020-09-2811-51/+63
| | | | | | | It's better, the majority of these changes look more readable to me. also found some docstrings that had formatting / quoting issues. Change-Id: I582a45fde3a5648b2f36bab96bad56881321899b
* Add deprecation warning for .join().alias()Gord Thompson2020-09-283-55/+53
| | | | | | | | | The :meth:`_sql.Join.alias` method is deprecated and will be removed in SQLAlchemy 2.0. An explicit select + subquery, or aliasing of the inner tables, should be used instead. Fixes: #5010 Change-Id: Ic913afc31f0d70b0605f9a7af2742a0de1f9ad19
* new docs WIPMike Bayer2020-09-243-37/+105
| | | | | | | | | | | | | | | This WIP is part of the final push for 1.4's docs to fully "2.0-ize" what we can, and have it all ready. So far this includes a rewrite of the 2.0 migration, set up for the 1.4 /2.0 docs style, and a total redesign of the index page using a new flex layout in zzzeeksphinx. It also reworks some of the API reference sections to have more subheaders. zzzeeksphinx is also enhanced to provide automatic summaries for all api doc section. Change-Id: I01d360cb9c8749520246b96ee6496143c6037918
* Complete deprecation of from_self()Mike Bayer2020-09-183-4/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For most from_self() tests, move them into test/orm/test_deprecated.py and replace the existing test with one that uses aliased() plus a subquery. This then revealed a few more issues. Related items: * Added slice() method to GenerativeSelect, to match that of orm.Query and to make possible migration of one of the from_self() tests. moved the utility functions used for this from orm/util into sql/util. * repairs a caching issue related to subqueryload where information being derived from the cached path info was mixing up with query information based on the per-query state, specifically an AliasedClass that is per query. * for the above issue, it seemed like path_registry maybe had to change so that it represents AliasedClass objects as their cache key rather than on identity, but it wasn't needed. still seems like it would be more correct. * enhances the error message raised by coercions for a case such as when an AliasedClass holds onto a select() object and not a subquery(); will name the original and resolved object for clarity (although how is AliasedClass able to accept a Select() object in the first place?) * Added _set_propagate_attrs() to Query so that again if it's passed to AliasedClass, it doesn't raise an error during coercion, but again maybe that should also be rejected up front Fixes: #5368 Change-Id: I5912aa611d899acc87a75eb5ee9f95990592f210
* Create a framework to allow all SQLALCHEMY_WARN_20 to passMike Bayer2020-09-162-3/+4
| | | | | | | | | | | | | | | | | | | | | As the test suite has widespread use of many patterns that are deprecated, enable SQLALCHEMY_WARN_20 globally for the test suite but then break the warnings filter out into a whole list of all the individual warnings we are looking for. this way individual changesets can target a specific class of warning, as many of these warnings will indivdidually affect dozens of files and potentially hundreds of lines of code. Many warnings are also resolved here as this patch started out that way. From this point forward there should be changesets that target a subset of the warnings at a time. For expediency, updates some migration 2.0 docs for ORM as well. Change-Id: I98b8defdf7c37b818b3824d02f7668e3f5f31c94
* Rename Core expression isnot, not_in_jonathan vanasco2020-09-143-21/+44
| | | | | | | | | | | | | | | | | | | Several operators are renamed to achieve more consistent naming across SQLAlchemy. The operator changes are: * `isnot` is now `is_not` * `not_in_` is now `not_in` Because these are core operators, the internal migration strategy for this change is to support legacy terms for an extended period of time -- if not indefinitely -- but update all documentation, tutorials, and internal usage to the new terms. The new terms are used to define the functions, and the legacy terms have been deprecated into aliases of the new terms. Fixes: #5429 Change-Id: Ia1e66e7a50ac35d3f6260d8bf6ba3ce8087cbad2
* Merge "Raname ``mustexit`` to ``must_exist``"mike bayer2020-09-121-3/+9
|\
| * Raname ``mustexit`` to ``must_exist``Federico Caselli2020-09-031-3/+9
| | | | | | | | | | | | | | :class:`_schema.Table` parameter ``mustexist`` has been renamed to :paramref:`_schema.Table.must_exist` and will now warn when used. Change-Id: I0b0ca6021f9f7cfbe2040bbc1125a2236ac79f53
* | Repair documentation issuesMike Bayer2020-09-092-7/+41
| | | | | | | | | | | | | | Fixes some remaining issues detailed at #5428. Fixes: #5428 Change-Id: I942a64411766fc82f30791eee570747a218af77d
* | Update select usage to use the new 1.4 formatFederico Caselli2020-09-088-139/+131
|/ | | | | | | | | | | | | | | | This change includes mainly that the bracketed use within select() is moved to positional, and keyword arguments are removed from calls to the select() function. it does not yet fully address other issues such as keyword arguments passed to the table.select(). Additionally, allows False / None to both be considered as "disable" for all of select.correlate(), select.correlate_except(), query.correlate(), which establishes consistency with passing of ``False`` for the legact select(correlate=False) argument. Change-Id: Ie6c6e6abfbd3d75d4c8de504c0cf0159e6999108
* Support extra / single inh criteria with ORM update/deleteMike Bayer2020-08-301-1/+22
| | | | | | | | | | | | | | | The ORM bulk update and delete operations, historically available via the :meth:`_orm.Query.update` and :meth:`_orm.Query.delete` methods as well as via the :class:`_dml.Update` and :class:`_dml.Delete` constructs for :term:`2.0 style` execution, will now automatically accommodate for the additional WHERE criteria needed for a single-table inheritance discrminiator. Joined-table inheritance is still not directly supported. The new :func:`_orm.with_loader_criteria` construct is also supported for all mappings with bulk update/delete. Fixes: #5018 Fixes: #3903 Change-Id: Id90827cc7e2bc713d1255127f908c8e133de9295
* Add support for regular expression on supported backend.Federico Caselli2020-08-274-1/+187
| | | | | | | | | | | | Two operations have been defined: * :meth:`~.ColumnOperators.regexp_match` implementing a regular expression match like function. * :meth:`~.ColumnOperators.regexp_replace` implementing a regular expression string replace function. Fixes: #1390 Change-Id: I44556846e4668ccf329023613bd26861d5c674e6
* Merge "Updates for MariaDB sequences"mike bayer2020-08-252-114/+167
|\
| * Updates for MariaDB sequencesFederico Caselli2020-08-222-114/+167
| | | | | | | | | | | | | | | | | | | | | | | | MariaDB should not run a Sequence if it has optional=True. Additionally, rework the rules in crud.py to accommodate the new combination MariaDB brings us, which is a dialect that supports both cursor.lastrowid, explicit sequences, *and* no support for returning. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Fixes: #5528 Change-Id: I9a8ea69a34983affa95dfd22186e2908fdf0d58c
* | Improve docs of Identity columns.Federico Caselli2020-08-241-1/+1
|/ | | | Change-Id: Iba85ac3c2c9f40878768d74a5dd33083fc68e504
* Merge "Add support for identity columns"mike bayer2020-08-212-23/+198
|\
| * Add support for identity columnsFederico Caselli2020-08-192-23/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the :class:`_schema.Identity` construct that can be used to configure identity columns rendered with GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY. Currently the supported backends are PostgreSQL >= 10, Oracle >= 12 and MSSQL (with different syntax and a subset of functionalities). Fixes: #5362 Fixes: #5324 Fixes: #5360 Change-Id: Iecea6f3ceb36821e8b96f0b61049b580507a1875
* | Add JSON support for mssqlGord Thompson2020-08-191-4/+17
|/ | | | | | | | | | Added support for the :class:`_types.JSON` datatype on the SQL Server dialect using the :class:`_mssql.JSON` implementation, which implements SQL Server's JSON functionality against the ``NVARCHAR(max)`` datatype as per SQL Server documentation. Implementation courtesy Gord Thompson. Fixes: #4384 Change-Id: I28af79a4d8fafaa68ea032228609bba727784f18
* Deliver straight BinaryExpr w/ no negate for any() / all()Mike Bayer2020-08-181-2/+10
| | | | | | | | | Adjusted the :meth:`_types.ARRAY.Comparator.any` and :meth:`_types.ARRAY.Comparator.all` methods to implement a straight "NOT" operation for negation, rather than negating the comparison operator. Fixes: #5518 Change-Id: I87ee9278c321aafe51a679fcfcbb5fbb11307fda
* Merge "Create a real type for Tuple() and handle appropriately in compiler"mike bayer2020-08-175-46/+63
|\
| * Create a real type for Tuple() and handle appropriately in compilerMike Bayer2020-08-175-46/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improved the :func:`_sql.tuple_` construct such that it behaves predictably when used in a columns-clause context. The SQL tuple is not supported as a "SELECT" columns clause element on most backends; on those that do (PostgreSQL, not surprisingly), the Python DBAPI does not have a "nested type" concept so there are still challenges in fetching rows for such an object. Use of :func:`_sql.tuple_` in a :func:`_sql.select` or :class:`_orm.Query` will now raise a :class:`_exc.CompileError` at the point at which the :func:`_sql.tuple_` object is seen as presenting itself for fetching rows (i.e., if the tuple is in the columns clause of a subquery, no error is raised). For ORM use,the :class:`_orm.Bundle` object is an explicit directive that a series of columns should be returned as a sub-tuple per row and is suggested by the error message. Additionally ,the tuple will now render with parenthesis in all contexts. Previously, the parenthesization would not render in a columns context leading to non-defined behavior. As part of this change, Tuple receives a dedicated datatype which appears to allow us the very desirable change of removing the bindparam._expanding_in_types attribute as well as ClauseList._tuple_values (which might already have not been needed due to #4645). Fixes: #5127 Change-Id: Iecafa0e0aac2f1f37ec8d0e1631d562611c90200
* | error message for LookupRamonWill2020-08-171-2/+15
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thr proposed change will provide the user with the target Enum Class name as well as up to four possible enum values when a LookupError is raised in the Enum Class. A user requested that the enum name and possible values are included to the LookupError message to make debugging easier. The criteria included using ellipses for Enums containing more than four values and using ellipses for enum values that were greater than a certain number of characters (for this resolution the limit is 11 characters). 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!** Fixes: #4733 Closes: #5490 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5490 Pull-request-sha: 55e76f2ae796b59b7de157cfaae5235dffa359cb Change-Id: I4541f9efed1c05401587a413e9e748d46938bcd1
* Merge "Implement rudimentary asyncio support w/ asyncpg"mike bayer2020-08-142-1/+20
|\
| * Implement rudimentary asyncio support w/ asyncpgMike Bayer2020-08-132-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the approach introduced at https://gist.github.com/zzzeek/6287e28054d3baddc07fa21a7227904e We can now create asyncio endpoints that are then handled in "implicit IO" form within the majority of the Core internals. Then coroutines are re-exposed at the point at which we call into asyncpg methods. Patch includes: * asyncpg dialect * asyncio package * engine, result, ORM session classes * new test fixtures, tests * some work with pep-484 and a short plugin for the pyannotate package, which seems to have so-so results Change-Id: Idbcc0eff72c4cad572914acdd6f40ddb1aef1a7d Fixes: #3414
* | Further fixes for ticket 5470Mike Bayer2020-08-131-5/+8
|/ | | | | | | | | | The fix for #5470 didn't actually take into account that the "distinct" logic in query was also doubling up the criteria. Added many more tests. the 1.3 version here will be different than 1.4 as the regression is not quite the same. Fixes: #5470 Change-Id: I16a23917cab175761de9c867d9d9ac55031d9b97
* Sweep through UPDATE ordered_values a second timeMike Bayer2020-08-122-15/+29
| | | | | | | | | | | | The fix in 180ae7c1a53385f72b0047496ac001ec5099cc3e didn't do much as the code was not preserving parameter order at all, in fact. Reworked stmt_parameters to be delivered in the correct order up front and preserve throughout crud.py which was not being done at all before. Fixes: #5510 Change-Id: I0795c71df73005a25d1bbf216732d41b41e11a5f
* Correct for update.ordered_values() and use in new testMike Bayer2020-08-111-3/+5
| | | | | | | | | | The test for the parameter fix in c0685e5f41 was not working deterministically on Python 2, so use ordered_values(), however a second issue in ordered_values() was assuming each element was a column, so also test for array-assignment expressions with ordered_values. Change-Id: I944c72a52700ffb4ab5ae1a83ae21f1efc84b505
* Fix typosKarthikeyan Singaravelan2020-08-091-1/+1
|
* render INSERT/UPDATE column expressions up front; pass stateMike Bayer2020-08-083-55/+167
| | | | | | | | | | | | | | | | | | | | | | Fixes related to rendering of complex UPDATE DML which was not correctly preserving positional parameter order in conjunction with DML features that are only known to work on the PostgreSQL database. Both pg8000 and asyncpg use positional parameters which is why these issues are suddenly apparent. crud.py now takes on the task of rendering the column expressions for SET or VALUES so that for the very unusual case that the column expression is a compound expression that includes a bound parameter (namely an array index), the bound parameter order is preserved. Additionally, crud.py passes through the positional_names keyword argument into bindparam_string() which is necessary when CTEs are being rendered, as PG supports complex CTE / INSERT / UPDATE scenarios. Change-Id: I7f03920500e19b721636b84594de78a5bfdcbc82
* Pass schema_translate_map from DDLCompiler to SQLCompilerMike Bayer2020-08-071-1/+3
| | | | | | | | | | | | Fixed issue where the :paramref:`_engine.Connection.execution_options.schema_translate_map` feature would not take effect when the :meth:`_schema.Sequence.next_value` function function for a :class:`_schema.Sequence` were used in the :paramref:`_schema.Column.server_default` parameter and the create table DDL were emitted. Fixes: #5500 Change-Id: I74a9fa13d22749d06c8202669f9ea220d9d984d9
* Implement relationship AND criteria; global loader criteriaMike Bayer2020-08-051-0/+4
| | | | | | | | | | | | | | | | | | | Added the ability to add arbitrary criteria to the ON clause generated by a relationship attribute in a query, which applies to methods such as :meth:`_query.Query.join` as well as loader options like :func:`_orm.joinedload`. Additionally, a "global" version of the option allows limiting criteria to be applied to particular entities in a query globally. Documentation is minimal at this point, new examples will be coming in a subsequent commit. Some adjustments to execution options in how they are represented in the ORMExecuteState as well as well as a few ORM tests that forgot to get merged in a preceding commit. Fixes: #4472 Change-Id: I2b8fc57092dedf35ebd16f6343ad0f0d7d332beb
* Convert lazy loader, selectinload, load_on_ident to lambda statementsMike Bayer2020-08-054-4/+58
| | | | | | | | | Building on newly robust lambdas in I29a513c98917b1d503abfdd61e6b6e8800851aa8, convert key loading off of the "baked" system so that baked is no longer used by the ORM. Change-Id: I3abfb45dd6e50f84f29d39434caa0b550ce27864
* Robustness for lambdas, lambda statementsMike Bayer2020-08-056-324/+880
| | | | | | | | | | | | | | | | | | | | in order to accommodate relationship loaders with lambda caching, a lot more is needed. This is a full refactor of the lambda system such that it now has two levels of caching; the first level caches what can be known from the __code__ element, then the next level of caching is against the lambda itself and the contents of __closure__. This allows for the elements inside the lambdas, like columns and entities, to change and then be part of the cache key. Lazy/selectinloads' use of baked queries had to add distinct cache key elements, which was attempted here but overall things needed to be more robust than that. This commit is broken out from the very long and sprawling commit at Id6b5c03b1ce9ddb7b280f66792212a0ef0a1c541 . Change-Id: I29a513c98917b1d503abfdd61e6b6e8800851aa8
* Genericize str() for typesMike Bayer2020-08-012-7/+24
| | | | | | | | | | | | | | Remove lookup logic that attempts to locate a dialect for a type, just use StrSQLTypeCompiler. Cleaned up the internal ``str()`` for datatypes so that all types produce a string representation without any dialect present, including that it works for third-party dialect types without that dialect being present. The string representation defaults to being the UPPERCASE name of that type with nothing else. Fixes: #4262 Change-Id: I02149e8a1ba1e7336149e962939b07ae0df83c6b
* Merge "Revise setinputsizes approach"mike bayer2020-07-232-16/+94
|\
| * Revise setinputsizes approachMike Bayer2020-07-192-16/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in order to support asyncpg as well as pg8000, we need to revise setinputsizes to work for more cases as well as adjust NativeForEmulated a bit to work more completely with the INTERVAL datatype. - put most of the setinputsizes work into the compiler where the computation can be cached. - support per-element setinputsizes for a tuple - adjust TypeDecorator so that _unwrapped_dialect_impl will honor a type that the dialect links to directly in it's adaption mapping. Decouble _unwrapped_dialect_impl from TypeDecorator._gen_dialect_impl() which has a different purpose. This allows setinputsizes to do the right thing with the INTERVAL datatype. - test cases for Oracle with Variant continue to work Change-Id: I9e1ea33aeca3b92b365daa4a356d778191070c03
* | Allow Grouping to pass along proxy_set of elementMike Bayer2020-07-211-0/+7
|/ | | | | | | | | | Repaired an issue where the "ORDER BY" clause rendering a label name rather than a complete expression, which is particularly important for SQL Server, would fail to occur if the expression were enclosed in a parenthesized grouping in some cases. This case has been added to test support. Fixes: #5470 Change-Id: Ie0e27c39e5d53be78b32f7810f93d2d0536375e7
* Convert remaining ORM APIs to support 2.0 styleMike Bayer2020-07-115-124/+222
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is kind of a mixed bag of all kinds to help get us to 1.4 betas. The documentation stuff is a work in progress. Lots of other relatively small changes to APIs and things. More commits will follow to continue improving the documentation and transitioning to the 1.4/2.0 hybrid documentation. In particular some refinements to Session usage models so that it can match Engine's scoping / transactional patterns, and a decision to start moving away from "subtransactions" completely. * add select().from_statement() to produce FromStatement in an ORM context * begin referring to select() that has "plugins" for the few edge cases where select() will have ORM-only behaviors * convert dynamic.AppenderQuery to its own object that can use select(), though at the moment it uses Query to support legacy join calling forms. * custom query classes for AppenderQuery are replaced by do_orm_execute() hooks for custom actions, a separate gerrit will document this * add Session.get() to replace query.get() * Deprecate session.begin->subtransaction. propose within the test suite a hypothetical recipe for apps that rely on this pattern * introduce Session construction level context manager, sessionmaker context manager, rewrite the whole top of the session_transaction.rst documentation. Establish context manager patterns for Session that are identical to engine * ensure same begin_nested() / commit() behavior as engine * devise all new "join into an external transaction" recipe, add test support for it, add rules into Session so it just works, write new docs. need to ensure this doesn't break anything * vastly reduce the verbosity of lots of session docs as I dont think people read this stuff and it's difficult to keep current in any case * constructs like case(), with_only_columns() really need to move to *columns, add a coercion rule to just change these. * docs need changes everywhere I look. in_() is not in the Core tutorial? how do people even know about it? Remove tons of cruft from Select docs, etc. * build a system for common ORM options like populate_existing and autoflush to populate from execution options. * others? Change-Id: Ia4bea0f804250e54d90b3884cf8aab8b66b82ecf
* Merge "Add future=True to create_engine/Session; unify select()"mike bayer2020-07-084-133/+430
|\
| * Add future=True to create_engine/Session; unify select()Mike Bayer2020-07-084-133/+430
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several weeks of using the future_select() construct has led to the proposal there be just one select() construct again which features the new join() method, and otherwise accepts both the 1.x and 2.x argument styles. This would make migration simpler and reduce confusion. However, confusion may be increased by the fact that select().join() is different Current thinking is we may be better off with a few hard behavioral changes to old and relatively unknown APIs rather than trying to play both sides within two extremely similar but subtly different APIs. At the moment, the .join() thing seems to be the only behavioral change that occurs without the user taking any explicit steps. Session.execute() will still behave the old way as we are adding a future flag. This change also adds the "future" flag to Session() and session.execute(), so that interpretation of the incoming statement, as well as that the new style result is returned, does not occur for existing applications unless they add the use of this flag. The change in general is moving the "removed in 2.0" system further along where we want the test suite to fully pass even if the SQLALCHEMY_WARN_20 flag is set. Get many tests to pass when SQLALCHEMY_WARN_20 is set; this should be ongoing after this patch merges. Improve the RemovedIn20 warning; these are all deprecated "since" 1.4, so ensure that's what the messages read. Make sure the inforamtion link is on all warnings. Add deprecation warnings for parameters present and add warnings to all FromClause.select() types of methods. Fixes: #5379 Fixes: #5284 Change-Id: I765a0b912b3dcd0e995426427d8bb7997cbffd51 References: #5159