summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * Consider default FROM DUAL for MySQLMike Bayer2020-07-292-1/+62
| | | | | | | | | | | | | | | | | | | | | | MySQL claims it doesn't require FROM DUAL for no FROM clause even though the issue at #5481 locates a case which requires one. See if FROM DUAL the same way as Oracle without attempting to guess is potentially feasible. Fixes: #5481 Change-Id: I2a28876c10a8ce2d121cd344dcdd837db321d4ab
* | Merge "Imply `sync_backref` flag in a viewonly relationship"mike bayer2020-07-291-22/+24
|\ \
| * | Imply `sync_backref` flag in a viewonly relationshipFederico Caselli2020-07-071-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update :paramref:`_orm.relationship.sync_backref` flag in a relationship to make it implicitly set to False in ``viewonly=True`` relationships, preventing synchronization events in all cases. References: #5237 Change-Id: Ib02b228a1b6e66b5ffd4540af776ac8f759c9a48
* | | Merge "Ensure is_comparison passed for PG RANGE op() methods"mike bayer2020-07-291-9/+9
|\ \ \
| * | | Ensure is_comparison passed for PG RANGE op() methodsJim Bosch2020-07-261-9/+9
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where the return type for the various RANGE comparison operators would itself be the same RANGE type rather than BOOLEAN, which would cause an undesirable result in the case that a :class:`.TypeDecorator` that defined result-processing behavior were in use. Pull request courtesy Jim Bosch. Fixes: #5476 Closes: #5477 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5477 Pull-request-sha: 925b117e0c91cdd67d9ddbd9d65f5ca3e88af91f Change-Id: I52ab4d4362d379c8253990f9d328a40990a64520
* | | Merge "Remove comment code lines"mike bayer2020-07-261-3/+0
|\ \ \ | |/ / |/| |
| * | Remove comment code linesj003562872020-07-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PyODBCConnector.initialize just super from Connector, no need to redeclare, so I guess that's why they are commented before. <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> Remove the useless comment code lines. ### 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: #5475 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5475 Pull-request-sha: 23176a7f0316d74407492c2bb299c88924ed0868 Change-Id: If94bb6275c30015e3aaa1519471b7d9bcda18bf8
* | | Update docs with actual MariaDB JSON supportDefteZ2020-07-261-2/+2
|/ /
* | Merge "Revise setinputsizes approach"mike bayer2020-07-233-60/+154
|\ \
| * | Revise setinputsizes approachMike Bayer2020-07-193-60/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Allow Grouping to pass along proxy_set of element"mike bayer2020-07-231-0/+7
|\ \ \
| * | | 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
* | | Ensure _distinct_on removed within from_selectableMike Bayer2020-07-201-0/+1
|/ / | | | | | | | | Fixes: #5469 Change-Id: I85498d3380c2efb595782d2ba92cfd692c3efc48
* | Fix mssql dialect escaping object names containing ']'Gord Thompson2020-07-181-1/+4
| | | | | | | | | | Fixes: #5467 Change-Id: I054ec219717ba62847a9daf1214e215dd6b70633
* | Add requirement for test_get_view_definitionGord Thompson2020-07-151-0/+1
| | | | | | | | | | | | Bypass the test if the views are not being created. Change-Id: I3945acb418575d12e5fe0e4657eb5e3b1c08b90e
* | Merge "test single and double quote inspection scenarios"2020_tutorialmike bayer2020-07-134-20/+166
|\ \
| * | test single and double quote inspection scenariosMike Bayer2020-07-134-20/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applied a sweep through all included dialects to ensure names that contain single or double quotes are properly escaped when querying system tables, for all :class:`.Inspector` methods that accept object names as an argument (e.g. table names, view names, etc). SQLite and MSSQL contained two quoting issues that were repaired. Fixes: #5456 Change-Id: I3bc98806f5166f3d82275650079ff561446f2aef
* | | Merge "more docs for autocommit isolation level"mike bayer2020-07-136-14/+25
|\ \ \
| * | | more docs for autocommit isolation levelMike Bayer2020-07-126-14/+25
| |/ / | | | | | | | | | | | | | | | | | | | | | this concept is not clear that we offer real DBAPI autocommit everywhere. backport 1.3 with edits as well Change-Id: I2e8328b7fb6e1cdc5453ab29c94276f60c7ca149
* | | Merge "Make call-count profiling tests on osx have their own platform key"mike bayer2020-07-133-0/+5
|\ \ \ | |/ / |/| |
| * | Make call-count profiling tests on osx have their own platform keyFederico Caselli2020-07-113-0/+5
| | | | | | | | | | | | | | | | | | | | | They previously would use the linux profiles, but recently some discrepancies in the function call count on osx would make the tests fail. Change-Id: Ifdfdca1676972de4179f59cdaae196f6805d4a21
* | | Further corrections to session docsMike Bayer2020-07-111-79/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | many more to come. One issue is that references to documentation sections inside of decorator-configured deprecation warnings will also generate a meaningless token when the runtime warning is emitted. It would be nice to improve upon this somehow. Change-Id: I16b214b3d310850bbfb0d9ade70235f5a9735eba
* | | Merge "Convert remaining ORM APIs to support 2.0 style"mike bayer2020-07-1118-836/+1230
|\ \ \ | |/ / |/| |
| * | Convert remaining ORM APIs to support 2.0 styleMike Bayer2020-07-1118-836/+1230
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 "Improvements to test_computed_col_default_not_set"mike bayer2020-07-091-6/+5
|\ \ \
| * | | Improvements to test_computed_col_default_not_setRafi Shamim2020-07-091-6/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> - Update the test so it looks at computed_default_table instead of computed_column_table. - Stop inspecting autoincrement; instead directly check for default/non-default values for the relevant columns. Fixes: #5414 ### 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: - [ ] 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: #5417 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5417 Pull-request-sha: 5918af6abb991e6d2322ea4252e56d456da628dc Change-Id: Id9484ae7f297735345016be5b7461325825503da
* | | Limit init_subclass test above python 3.6Mike Bayer2020-07-081-0/+7
|/ / | | | | | | | | | | | | | | The commit for I1654befe9eb1c8b8e7fc0784bdbe64284614f0ea #5357 runs the test on all Python 3 versions, however we need to limit at least python 3.6 for this. Change-Id: Ie86b78bbfd8c7bd013ff9aa7f8905328d792c1b3
* | Merge remote-tracking branch 'origin/pr/5439'Mike Bayer2020-07-081-0/+3
|\ \ | | | | | | | | | Change-Id: Ibab5889b14c546a8c43c5eaf88ed5d1f53713880
| * | resolves #3757RamonWill2020-07-041-0/+3
| | |
* | | Merge "Add future=True to create_engine/Session; unify select()"mike bayer2020-07-0824-421/+661
|\ \ \ | |_|/ |/| |
| * | Add future=True to create_engine/Session; unify select()Mike Bayer2020-07-0824-421/+661
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "ensure we unwrap desc() /label() all the way w/ order by"mike bayer2020-07-071-1/+19
|\ \
| * | ensure we unwrap desc() /label() all the way w/ order byMike Bayer2020-07-071-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The deprecated logic to move order_by expressions up into the columns clause needed adjustment to accommodate for a more deeply-wrapped structure when desc() + label() are combined in an order by column. This structure now comes from coercions in 1.4. it's not clear to me at the moment why it's different from 1.3 but this shouldn't really matter. Fixes: #5443 Change-Id: If909a86f715992318d7aa283603197f7711f1d3b
* | | Merge "Add **kw support to DeclarativeMeta.__init__"mike bayer2020-07-071-1/+1
|\ \ \ | |/ / |/| |
| * | Add **kw support to DeclarativeMeta.__init__EwenGillies2020-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a ``**kw`` argument to the :meth:`.DeclarativeMeta.__init__` method. This allows a class to support the :pep:`487` metaclass hook ``__init_subclass__``. Pull request courtesy Ewen Gillies. Fixes: #5357 Closes: #5363 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5363 Pull-request-sha: 0ad05a768316cba03a4d312ab39d3e8fbca7ac54 Change-Id: I1654befe9eb1c8b8e7fc0784bdbe64284614f0ea
* | | Merge "added semicolon (;) to improve warning message clarity"mike bayer2020-07-061-1/+1
|\ \ \
| * | | added semicolon (;) to improve warning message clarityjonathan vanasco2020-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Description Added a semicolon to improve the clarity of warning message. I actually had a table named `backend`, and thought it was involved! While updating the code, I noticed no test that directly tests for this warning message. There are tests for the `Can't sort tables for DROP;` prefix of this message and the `exc.CircularDependencyError`; and some tests for the `exc.CircularDependencyError` message itself. I couldn't find any test for this particular message though. (Just thought I'd bring that up) No issue created, because this is minor. Closes: #5431 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5431 Pull-request-sha: 87fb5733ff4fc1a13dd94277716814ea852f654c Change-Id: I87a504d30a7dd5155c34f7d7f30b2116d0d3cd3f
* | | | Ensure synchronize_session works with lambda statementsMike Bayer2020-07-051-6/+31
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few places have logic that assumes the top-level statement is the actual UPDATE or DELETE which is not the case with a lambda. Ensure the correct object is used. This fixes issues specific to both "fetch" strategy as well as "evaluate" strategy. Fixes: #5442 Change-Id: Ic9cc01c696c3c338d5bc79688507e6717c4c169b
* | | Document pyodbc built-in poolingMike Bayer2020-07-051-0/+26
| |/ |/| | | | | | | | | | | | | | | PyODBC apparently pools connections by default and this is a module-wide setting only. Documenent that this happens and how to disable it. Fixes: #5440 Change-Id: I415bda7beb2211c66991b6c804b0ddb4d79e427f
* | introduce deferred lambdasMike Bayer2020-07-0321-103/+884
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The coercions system allows us to add in lambdas as arguments to Core and ORM elements without changing them at all. By allowing the lambda to produce a deterministic cache key where we can also cheat and yank out literal parameters means we can move towards having 90% of "baked" functionality in a clearer way right in Core / ORM. As a second step, we can have whole statements inside the lambda, and can then add generation with __add__(), so then we have 100% of "baked" functionality with full support of ad-hoc literal values. Adds some more short_selects tests for the moment for comparison. Other tweaks inside cache key generation as we're trying to approach a certain level of performance such that we can remove the use of "baked" from the loader strategies. As we have not yet closed #4639, however the caching feature has been fully integrated as of b0cfa7379cf8513a821a3dbe3028c4965d9f85bd, we will also add complete caching documentation here and close that issue as well. Closes: #4639 Fixes: #5380 Change-Id: If91f61527236fd4d7ae3cad1f24c38be921c90ba
* Merge "Rename Table.tometadata to to_metadata"mike bayer2020-06-294-18/+72
|\
| * Rename Table.tometadata to to_metadataGord Thompson2020-06-294-18/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Renamed the :meth:`_schema.Table.tometadata` method to :meth:`_schema.Table.to_metadata`. The previous name remains with a deprecation warning. Updated the "decorate" utility function to support decoration of functions that include non-builtins as default values. Moves test for deprecated "databases" package into test/dialect/test_deprecations.py Fixes: #5413 Fixes: #5426 Change-Id: I6ed899871c935f9e46360127c17ccb7cf97cea6e
* | Include DATETIME / DateTime with the MySQL TIMESTAMP examplesMike Bayer2020-06-291-3/+22
| | | | | | | | | | | | | | | | | | To eliminate any remaining confusion, clarify that DATETIME (as well as DateTime) and TIMESTAMP are treated similarly with the MySQL dialect regarding ON UPDATE. Change-Id: I222522440706902d5d2d11e670e76f16000438e0 References: #5427
* | Merge "Remove _generate_path_cache_key()"mike bayer2020-06-293-129/+7
|\ \
| * | Remove _generate_path_cache_key()Mike Bayer2020-06-293-129/+7
| |/ | | | | | | | | | | | | | | | | | | loader options can now make a deterministic cache key based on the structure they are given, and this accommodates for aliased classes as well so that these cache keys are now "safe". Have baked query call upon the regular cache key method. Change-Id: Iaa2ef4064cfb16146f415ca73080f32003dd830d
* | Merge "Provide example for exists"mike bayer2020-06-291-1/+9
|\ \
| * | Provide example for existsFederico Caselli2020-06-271-1/+9
| | | | | | | | | | | | | | | | | | Fixes: #5423 Change-Id: I716f8de17c49d7eefbbce5ddd9da203bfc9fe47f
* | | Docuemnt current workarounds for MySQL TIMESTAMPMike Bayer2020-06-292-1/+73
| |/ |/| | | | | | | | | | | | | | | | | | | MySQL 8 no longer generates the DEFAULT or ON UPDATE clauses for TIMESTAMP by default, hence users will begin to hit this regularly. add warnings that this non-standard SQL is not accommodated by server_onupdate and docuemnt the workaround used in issues such as #4652. Fixes: #5427 Change-Id: Ie048dcc91c648dd0b80ed395208c1d665b6c968b
* | Merge "ORM executemany returning"mike bayer2020-06-286-49/+156
|\ \ | |/ |/|
| * ORM executemany returningMike Bayer2020-06-276-49/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Build on #5401 to allow the ORM to take advanage of executemany INSERT + RETURNING. Implemented the feature updated tests to support INSERT DEFAULT VALUES, needed to come up with a new syntax for compiler INSERT INTO table (anycol) VALUES (DEFAULT) which can then be iterated out for executemany. Added graceful degrade to plain executemany for PostgreSQL <= 8.2 Renamed EXECUTEMANY_DEFAULT to EXECUTEMANY_PLAIN Fix issue where unicode identifiers or parameter names wouldn't work with execute_values() under Py2K, because we have to encode the statement and therefore have to encode the insert_single_values_expr too. Correct issue from #5401 to support executemany + return_defaults for a PK that is explicitly pre-generated, meaning we aren't actually getting RETURNING but need to return it from compiled_parameters. Fixes: #5263 Change-Id: Id68e5c158c4f9ebc33b61c06a448907921c2a657