summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fix typo in pickletypeCaselIT-patch-1Federico Caselli2020-03-041-1/+1
|
* Merge "Remove the deprecated loader options"mike bayer2020-03-046-91/+12
|\
| * Remove the deprecated loader optionsFederico Caselli2020-03-036-91/+12
| | | | | | | | | | | | | | | | | | Remove the deprecated loader options ``joinedload_all``, ``subqueryload_all``, ``lazyload_all``, ``selectinload_all``. The normal version with method chaining should be used in their place. Fixes: #4642 Change-Id: I12eb4dfa7a86375911a570934ee662653d85d50a
* | Merge "Restore crud flags if visiting_cte is set"mike bayer2020-03-044-2/+49
|\ \
| * | Restore crud flags if visiting_cte is setMike Bayer2020-03-034-2/+49
| |/ | | | | | | | | | | | | | | | | | | Fixed bug where a CTE of an INSERT/UPDATE/DELETE that also uses RETURNING could then not be SELECTed from directly, as the internal state of the compiler would try to treat the outer SELECT as a DELETE statement itself and access nonexistent state. Fixes: #5181 Change-Id: Icba76f2148c8344baa1c04bac4ab6c6d24f23072
* | Run handle_error for any exceptions raised in execute_context()Mike Bayer2020-03-033-30/+111
|/ | | | | | | | | | | | | | | | | | | | | Observing a SQLite connection/cursor being hung on test_resultset -> PositionalTextTest -> test_dupe_col_obj. this uses connectionless execution and the result object fails to be constructed. When that happens, there is no path for the cursor or connection to be closed / released. Recent changes with the exception assertions in #4849 seem to be causing a cycle to last a little longer than usual which is exposing this issue for one particular test on SQLite. As we want to get rid of weakref cleanup, evaluate why we dont have handle_dbapi_exception for this whole block, as after_cursor_execute can raise, result construction can raise, autocommit can raise, close can raise, there does not seem to be a reason these things should be outside of the block that gets cleaned up. Fixes: #5182 Change-Id: I640ac55e8c5f39d287f779fbb5dc0ab727218ca3
* Include column_property composition examplesMike Bayer2020-03-034-13/+80
| | | | | | | | | | | | Add cross-linking between column_property() and ColumnProperty Add section to describe using .expression remove inherited-members from ColumnProperty to greatly decrease verbosity Fixes: #5179 Change-Id: Ic477b16350dbf551100b31d14ff3ba8ba8221a43
* Merge "Ensure all nested exception throws have a cause"mike bayer2020-03-0250-435/+768
|\
| * Ensure all nested exception throws have a causeMike Bayer2020-03-0250-435/+768
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applied an explicit "cause" to most if not all internally raised exceptions that are raised from within an internal exception catch, to avoid misleading stacktraces that suggest an error within the handling of an exception. While it would be preferable to suppress the internally caught exception in the way that the ``__suppress_context__`` attribute would, there does not as yet seem to be a way to do this without suppressing an enclosing user constructed context, so for now it exposes the internally caught exception as the cause so that full information about the context of the error is maintained. Fixes: #4849 Change-Id: I55a86b29023675d9e5e49bc7edc5a2dc0bcd4751
* | Merge "Remove obsolete util.compat.nested"mike bayer2020-03-023-47/+8
|\ \
| * | Remove obsolete util.compat.nestedGord Thompson2020-03-023-47/+8
| | | | | | | | | | | | | | | Fixes: #5177 Change-Id: Ie02b0c065e3833f43e056ad9c31f414871d9e8ee
* | | Merge "Deprecate the databases packages"mike bayer2020-03-029-12/+30
|\ \ \ | |_|/ |/| |
| * | Deprecate the databases packagesFederico Caselli2020-02-289-12/+30
| | | | | | | | | | | | | | | | | | | | | The databases package is an old alias to the dialect package, and its usage is now deprecated Change-Id: I5343a2d270ed5a8c654b9fe13dff40cdf54649ed
* | | Update dialect API documentationMike Bayer2020-03-022-60/+128
| |/ |/| | | | | | | | | | | | | | | | | The docstrings for connect() and on_connect() were incorrect between Dialect vs. DefaultDialect. Redocumented related methods, clean up formatting, and remove unicode-related attribute descriptions from the top level Dialect document as these don't apply to Python 3. Change-Id: I45baab757f8e20627eba42c30b9e8dbe26356275
* | Merge "Discontinue dynamic __visit_name__"mike bayer2020-03-025-74/+64
|\ \
| * | Discontinue dynamic __visit_name__Mike Bayer2020-03-015-74/+64
| |/ | | | | | | | | | | | | | | | | Removed very antiquated logic that checks if __visit_name__ is a property. There's no need for this as the compiler can handle switching between implementations. Convert _compile_dispatch() to be fully inlined. Change-Id: Ic0c7247c2d7dfed93a27f09250a8ed6352370764
* | Merge "While parsing for check constraints, ignore newline characters in the ↵mike bayer2020-03-013-2/+53
|\ \ | | | | | | | | | check condition"
| * | While parsing for check constraints, ignore newline characters in the check ↵Eric Borczuk2020-02-293-2/+53
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | condition Fixed bug where PostgreSQL reflection of CHECK constraints would fail to parse the constraint if the SQL text contained newline characters. The regular expression has been adjusted to accommodate for this case. Pull request courtesy Eric Borczuk. Fixes: #5170 Closes: #5172 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5172 Pull-request-sha: 5701b7f09f723b727bbee95d19d107d6cc1d7717 Change-Id: If727e9140b645e8b685c3476fb0fa4417c1e6526
* | Merge "Open up check for relationships that write to the same column"mike bayer2020-02-2919-30/+268
|\ \ | |/ |/|
| * Open up check for relationships that write to the same columnMike Bayer2020-02-2719-30/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enhanced logic that tracks if relationships will be conflicting with each other when they write to the same column to include simple cases of two relationships that should have a "backref" between them. This means that if two relationships are not viewonly, are not linked with back_populates and are not otherwise in an inheriting sibling/overriding arrangement, and will populate the same foreign key column, a warning is emitted at mapper configuration time warning that a conflict may arise. A new parameter :paramref:`.relationship.overlaps` is added to suit those very rare cases where such an overlapping persistence arrangement may be unavoidable. Fixes: #5171 Change-Id: Ifae5998fc1c7e49ce059aec8a67c80cabee768ad
* | Merge "Remove print statement in favor of print() function in docs and examples"mike bayer2020-02-2819-63/+63
|\ \ | |/ |/|
| * Remove print statement in favor of print() function in docs and examplesAlbert Tugushev2020-02-2619-63/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description <!-- Describe your changes in detail --> Remove print statements ### 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: #5166 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5166 Pull-request-sha: 04a7394f71298322188f0861b4dfe93e5485839d Change-Id: Ib90a59fac929661a18748c6e44966fb87e3978c6
* | Don't call pre_ping for fresh connectionMike Bayer2020-02-263-15/+111
|/ | | | | | | | | | The pool "pre-ping" feature has been refined to not invoke for a DBAPI connection that was just opened in the same checkout operation. pre ping only applies to a DBAPI connection that's been checked into the pool and is being checked out again. Fixes: #4524 Change-Id: Ibe3dfb709dbdc24aa94e96513cfbea456c33b895
* Merge "Revise cx_Oracle, mysqlclient versions"mike bayer2020-02-241-14/+16
|\
| * Revise cx_Oracle, mysqlclient versionsMike Bayer2020-02-181-14/+16
| | | | | | | | | | | | | | | | | | | | cx_Oracle is dropping Python 2 in version 8.0 mysqlclient is dropping Python 2 in version 2.0 We are no longer testing cx_Oracle < 7 on CI so drop older cx_Oracle versions from tox. Change-Id: I18d8b47077d50ac02aedb6fdeb24f7c99b56aa7c
* | Merge "Clean up test_types.py in test suite"mike bayer2020-02-241-65/+71
|\ \
| * | Clean up test_types.py in test suiteGord Thompson2020-02-231-65/+71
| | | | | | | | | | | | | | | | | | | | | Convert connectionless execution calls to use preferred methods Change-Id: I64c49cb9b495007d43fc6c83e677a19cc2c6c9b9
* | | Remove needless clauseelement check for batchMike Bayer2020-02-242-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Also document more detail as to why SQL expression support is not turned on for batch. Fixes: #5165 Change-Id: Ia93bbf75f22b8781400086c45b86a60ef9cec360
* | | Deprecate row.keys() for 2.0, not 1.xMike Bayer2020-02-243-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | row.keys() is used by any use case that applies dict() to a row. Access of elements by string key is also a 2.0 deprecation not 1.4 so for rudimental dict(row) support make sure that is all a 2.0 thing. Fixes current Alembic test suite. Change-Id: I895496324133d615676cd76bc5f2c5f4a83e9131
* | | Merge "Ensure schema-level table includes annotations in caching"mike bayer2020-02-242-2/+41
|\ \ \ | |/ / |/| |
| * | Ensure schema-level table includes annotations in cachingMike Bayer2020-02-242-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 29330ec159 we ensured that annotations are part of cache keys. However we failed to do so for the schema-level Table which will definitely need to distinguish between ORM and non-ORM annotated tables when caching, so ensure this is part of the cache key. Change-Id: I8d996873f2d7fa63230ef837db7e69a0101973b2
* | | Ensure descendants of mixins don't become cacheableMike Bayer2020-02-223-11/+19
|/ / | | | | | | | | | | | | | | | | | | HasPrefix / HasSuffixes / SupportsCloneAnnotations exported a _traverse_internals attribute that does not represent a complete traversal, meaning non-traversible subclasses would seem traversible. rename these attributes so that this does not occur. DML is currently not traversible (will be soon). Change-Id: I2605e61c8c3d49965335e66e09f4aeedc5e73bd3
* | Merge "Repair inline flag"mike bayer2020-02-228-16/+144
|\ \
| * | Repair inline flagMike Bayer2020-02-228-16/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 9fca5d827d we attempted to deprecate the "inline=True" flag and add a generative inline() method, however failed to include any tests and the method was implemented incorrectly such that it would get overwritten with the boolean flag immediately. Rename the internal "inline" flag to "_inline" and add test support both for the method as well as deprecated support for the flag, including a fixture addition to assert the expected value of the flag as it generally does not affect the actual compiled SQL string. Change-Id: I0450049f17f1f0d91e22d27f1a973a2b6c0e59f7
* | | Merge remote-tracking branch 'origin/pr/5141'Mike Bayer2020-02-222-4/+4
|\ \ \ | | | | | | | | | | | | Change-Id: If7e15115de22b0aa562a93f09d2287966914d96c
| * | | fix documentation typosFederico Caselli2020-02-082-4/+4
| | | | | | | | | | | | | | | | Change-Id: I4376910ae1cf6bf27226f049d4cf2d0e6ba2a83b
* | | | Update test_unicode and move to test suiteGord Thompson2020-02-222-60/+54
| |/ / |/| | | | | | | | | | | | | | | | | | | | External dialects will definitely want to be able to test their handling of Unicode table/column names. Change-Id: If1b67cf170dc9e4a42e3f51760ced8ddb7a34fcf
* | | Result initial introductionMike Bayer2020-02-2166-1842/+3402
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This builds on cc718cccc0bf8a01abdf4068c7ea4f3 which moved RowProxy to Row, allowing Row to be more like a named tuple. - KeyedTuple in ORM is replaced with Row - ResultSetMetaData broken out into "simple" and "cursor" versions for ORM and Core, as well as LegacyCursor version. - Row now has _mapping attribute that supplies full mapping behavior. Row and SimpleRow both have named tuple behavior otherwise. LegacyRow has some mapping features on the tuple which emit deprecation warnings (e.g. keys(), values(), etc). the biggest change for mapping->tuple is the behavior of __contains__ which moves from testing of "key in row" to "value in row". - ResultProxy breaks into ResultProxy and FutureResult (interim), the latter has the newer APIs. Made available to dialects using execution options. - internal reflection methods and most tests move off of implicit Row mapping behavior and move to row._mapping, result.mappings() method using future result - a new strategy system for cursor handling replaces the various subclasses of RowProxy - some execution context adjustments. We will leave EC in but refined things like get_result_proxy() and out parameter handling. Dialects for 1.4 will need to adjust from get_result_proxy() to get_result_cursor_strategy(), if they are using this method - out parameter handling now accommodated by get_out_parameter_values() EC method. Oracle changes for this. external dialect for DB2 for example will also need to adjust for this. - deprecate case_insensitive flag for engine / result, this feature is not used mapping-methods on Row are deprecated, and replaced with Row._mapping.<meth>, including: row.keys() -> use row._mapping.keys() row.items() -> use row._mapping.items() row.values() -> use row._mapping.values() key in row -> use key in row._mapping int in row -> use int < len(row) Fixes: #4710 Fixes: #4878 Change-Id: Ieb9085e9bcff564359095b754da9ae0af55679f0
* | | Deprecate connection branchingMike Bayer2020-02-2121-272/+510
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The :meth:`.Connection.connect` method is deprecated as is the concept of "connection branching", which copies a :class:`.Connection` into a new one that has a no-op ".close()" method. This pattern is oriented around the "connectionless execution" concept which is also being removed in 2.0. As part of this change we begin to move the internals away from "connectionless execution" overall. Remove the "connectionless execution" concept from the reflection internals and replace with explicit patterns at the Inspector level. Fixes: #5131 Change-Id: Id23d28a9889212ac5ae7329b85136157815d3e6f
* | | doc updates to 2.0 migration documentMike Bayer2020-02-211-45/+68
| | | | | | | | | | | | | | | | | | | | | | | | use Result instead of InvocationContext which will place itself in the execution sequence in mostly the same way as ResultProxy does. Change-Id: Ice9e231734b67d31af4fc9da8190b06a5404d970
* | | Merge "Remove unnecessary tuple; prepare for "iterator" verbiage"mike bayer2020-02-203-27/+27
|\ \ \
| * | | Remove unnecessary tuple; prepare for "iterator" verbiageMike Bayer2020-02-203-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove a tuple surrounding a generator expression that is immediately iterated in any case. Additionally note that the bulk methods can likely accept non-list objects such as arbitrary iterables, however without test coverage this is not yet guaranteed; use the term "sequence" for now. Also added a warmup to a cache key profiling test to get consistent results. Fixes: #5163 Change-Id: If838fe214da574763115855c1a65171533c96e64
* | | | Modernize test_rowcount and move to dialect suiteMike Bayer2020-02-192-55/+54
|/ / / | | | | | | | | | | | | | | | | | | Amazingly there are no "rowcount" tests in suite, so these tests should definitely be there. Change-Id: Ib4c595fe6e16b457680ce4ee01180ccc8ddb6a40
* | | Merge "Replace engine.execute w/ context manager (step1)"mike bayer2020-02-197-123/+138
|\ \ \
| * | | Replace engine.execute w/ context manager (step1)Gord Thompson2020-02-177-123/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First (baby) step at replacing engine.execute calls in test code with the new preferred way of executing. MSSQL was targeted because it was the easiest for me to test locally. Change-Id: Id2e02f0e39007cbfd28ca6a535115f53c6407015
* | | | Merge "Pass DDLCompiler IdentifierPreparer to visit_ENUM"mike bayer2020-02-174-3/+87
|\ \ \ \ | |_|_|/ |/| | |
| * | | Pass DDLCompiler IdentifierPreparer to visit_ENUMMike Bayer2020-02-174-3/+87
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed issue where the "schema_translate_map" feature would not work with a PostgreSQL native enumeration type (i.e. :class:`.Enum`, :class:`.postgresql.ENUM`) in that while the "CREATE TYPE" statement would be emitted with the correct schema, the schema would not be rendered in the CREATE TABLE statement at the point at which the enumeration was referenced. Fixes: #5158 Change-Id: I41529785de2e736c70a142c2ae5705060bfed73e
* | | Merge "Create initial future package, RemovedIn20Warning"mike bayer2020-02-1729-157/+1583
|\ \ \
| * | | Create initial future package, RemovedIn20WarningMike Bayer2020-02-1229-157/+1583
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reorganization of Select() is the first major element of the 2.0 restructuring. In order to start this we need to first create the new Select constructor and apply legacy elements to the old one. This in turn necessitates starting up the RemovedIn20Warning concept which itself need to refer to "sqlalchemy.future", so begin to establish this basic framework. Additionally, update the DML constructors with the newer no-keyword style. Remove the use of the "pending deprecation" and fix Query.add_column() deprecation which was not acting as deprecated. Fixes: #4845 Fixes: #4648 Change-Id: I0c7a22b2841a985e1c379a0bb6c94089aae6264c
* | | | Merge "Begin to disallow back_populates with viewonly=True"mike bayer2020-02-173-0/+50
|\ \ \ \