Mike Bayer [Tue, 16 May 2017 13:51:06 +0000 (09:51 -0400)]
modernize and repair inheritance examples
remarkably, the examples for concrete and single were still
using classical mappings. Ensure all three examples use
modern declarative patterns, each illustrate the identical set
of query operations. Use back_populates, flat=True for joins,
etc. ensure flake8 linting, correct links and add a link back
from newly reworked inheritance documentation.
Mike Bayer [Fri, 12 May 2017 13:23:44 +0000 (09:23 -0400)]
Add links to with_only_columns to Select.column, append_column
Provide a brief example for these two methods
indicating that typically a table-bound (or other selectable)
column is appended here, then link to with_only_columns
documentation which has in-depth guidelines already including
that one should not append columns from the current select to itself.
Mike Bayer [Mon, 1 May 2017 17:04:32 +0000 (13:04 -0400)]
Update inheritance documentation.
The inheritance documentation is confused, disorganized, and out
of date. Reorganize and clarify, in particular in preparation
for new inheritance features.
Mike Bayer [Fri, 5 May 2017 18:59:39 +0000 (14:59 -0400)]
- big rewrite of the Sequence documentation:
1. Sequence should be associated with MetaData always,
except in the really weird case someone is sharing a Sequence
among multiple metadatas. Make this a "best practice", end the
confusion of #3951, #3979
2. "optional" is not a thing people use, trim this way down
Mike Bayer [Fri, 5 May 2017 14:39:18 +0000 (10:39 -0400)]
- add another note re: 339e2c13b0fc8e95a47d00c0f8fc5afc4b6dff9a
which clarifies that ForeignKey circumvents this logic as a
"convenience". issue #3978 is updated to address trying to make
this consistent.
Mike Bayer [Mon, 24 Apr 2017 20:19:08 +0000 (16:19 -0400)]
test / document postgresql_ops against a labeled expression
Since postgresql_ops explicitly states that it expects
string keys, to apply to a function call or expression one
needs to give the SQL expression a label that can be referred
to by name in the dictionary. test / document this.
Mike Bayer [Mon, 13 Mar 2017 16:27:51 +0000 (12:27 -0400)]
Repair _execute_scalar for WITH_UNICODE mode
cx_Oracle 5.3 seems to code this flag ON now, so
remove the warning and ensure WITH_UNICODE handling works.
Additionally, the XE setup on jenkins is having more
problems here, in particular low-connections mode is
causing cx_Oracle to fail more frequently now. Turning
off low-connections fixes those but then we get the
TNS errors, so adding an emergency "retry" flag that
is not yet a feature available to users. Real world
applications are not dropping/creating thousands of
tables the way our test suite is.
Mike Bayer [Thu, 26 Jan 2017 21:01:20 +0000 (16:01 -0500)]
- document that "column" and "where" are arbitrary SQL expressions
for ExcludeConstraint, if string is used then quoting must
be applied manually. fixes #3899
Mike Bayer [Thu, 19 Jan 2017 19:12:19 +0000 (14:12 -0500)]
Improve server-side Sequence documentation
Include the metadata argument for the Sequence
and explain the rationale. Correct inconsistencies
between Core / ORM examples and update language
regarding client side vs. server side Sequence
directive.
Corrects some warnings and adds tox config. Adds DeprecationWarning
to the error category. Large sweep for string literals w/ backslashes
as this is common in docstrings
Mike Bayer [Mon, 9 Jan 2017 19:16:22 +0000 (14:16 -0500)]
Adapt from "localparent" in joinedloader
Fixed bug involving joined eager loading against multiple entities
when polymorphic inheritance is also in use which would throw
"'NoneType' object has no attribute 'isa'". The issue was introduced
by the fix for :ticket:`3611`.
Mike Bayer [Thu, 10 Nov 2016 22:08:06 +0000 (17:08 -0500)]
Quote URL tokens with semicolons for pyodbc, adodbapi
Fixed bug in pyodbc dialect (as well as in the mostly non-working
adodbapi dialect) whereby a semicolon present in the password
or username fields could be interpreted as a separator for another
token; the values are now quoted when semicolons are present.
Mike Bayer [Thu, 10 Nov 2016 19:24:48 +0000 (14:24 -0500)]
Use configured props for mapper.attrs, mapper.all_orm_descriptors
Fixed bug where the :attr:`.Mapper.attrs`,
:attr:`.Mapper.all_orm_descriptors` and other derived attributes would
fail to refresh when mapper properties or other ORM constructs were
added to the mapper/class after these accessors were first called.
Matt Riedemann [Mon, 10 Oct 2016 15:43:07 +0000 (11:43 -0400)]
Update the Column.nullable docstring for the primary_key=True case
While reviewing a change that created a new table, the
primary_key column value was set to True but nullable was not
explicitly set, which led to some confusion over the default
behavior for the nullable column value when setting a primary_key.
Looking at the docs it's not clear, but the code shows that if
nullable is not specified, then nullable = not primary_key, so
nullable defaults to False when primary_key is True.
This patch adds a simple clarification to the docs so people
don't have to check the code.
Change-Id: I8553339d56fbae11370c7c6af6d8d4723163be1c
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/312
(cherry picked from commit 4b94ee113baab901aee881ad94851587c912f785)
Mike Bayer [Tue, 4 Oct 2016 16:01:12 +0000 (12:01 -0400)]
- add a note to baked documentation indicating it is not
really of general use. This extension is there only
for those who really want it based on observed performance
characteristics.
Mike Bayer [Tue, 4 Oct 2016 15:32:20 +0000 (11:32 -0400)]
Use schema_name() for SQL Server default schema
Changed the query used to get "default schema name", from one that
queries the database principals table to using the
"schema_name()" function, as issues have been reported that the
former system was unavailable on the Azure Data Warehouse edition.
It is hoped that this will finally work across all SQL Server
versions and authentication styles.
Mike Bayer [Tue, 4 Oct 2016 15:17:26 +0000 (11:17 -0400)]
Use SQL Server SERVERPROPERTY for version info w/ pyodbc
Updated the server version info scheme for pyodbc to use SQL Server
SERVERPROPERTY(), rather than relying upon pyodbc.SQL_DBMS_VER, which
continues to be unreliable particularly with FreeTDS.
Mike Bayer [Sat, 24 Sep 2016 04:49:22 +0000 (00:49 -0400)]
- improve documentation for SessionTransaction re: parent
and nested attributes and what these mean
- improve linking for after_transaction_create() / after_transaction_end()
events
- add public .parent attribute to detect top-level transaction within
these events
Mike Bayer [Thu, 22 Sep 2016 15:08:09 +0000 (11:08 -0400)]
- clarify documentation on timezone flag, since Oracle has both
DATE / TIMESTAMP separately the timezone flag will not bump the
type to TIMESTAMP WITH TIMEZONE on that backend.
Mike Bayer [Wed, 21 Sep 2016 21:55:39 +0000 (17:55 -0400)]
Ensure mapper.polymorphic_on is polymorphic_prop.columns[0]
Fixed bug where joined eager loading would fail for a polymorphically-
loaded mapper, where the polymorphic_on was set to an un-mapped
expression such as a CASE expression.
Mike Bayer [Thu, 15 Sep 2016 04:50:17 +0000 (00:50 -0400)]
Repair foreign_keys population for Join._refresh_for_new_column
Fixed bug where setting up a single-table inh subclass of a joined-table
subclass which included an extra column would corrupt the foreign keys
collection of the mapped table, thereby interfering with the
initialization of relationships.
Edouard Berthe [Wed, 31 Aug 2016 06:52:48 +0000 (16:52 +1000)]
Corrects typo
This example doesn't work with 'back_populates' because 'parent_associations' and 'child_associations' are not defined in Parent and Child classes respectively.
Alternatively, we could create 'parent_associations' and 'child_associations' into the classes.
(cherry picked from commit 53c3119ebb6801cbfcaf2841311d117eba250444)
Mike Bayer [Mon, 15 Aug 2016 20:39:12 +0000 (16:39 -0400)]
Rework _apply_joins(), _prep_for_joins() totally
The approach here is still error prone
and hard to follow. Reorganize the whole
thing to take a pretty blunt approach to
the structure of to_join(). Also fix some never-called
code (!) in _prep_for_joins() and ensure we re-use
an aliased object.
Mike Bayer [Sat, 13 Aug 2016 03:35:40 +0000 (23:35 -0400)]
Ensure final link in subqueryload join is correct
Fixed bug in subquery eager loading where a subqueryload
of an "of_type()" object linked to a second subqueryload of a plain
mapped class would fail to link the joins correctly.
brln [Tue, 2 Aug 2016 22:37:35 +0000 (18:37 -0400)]
Warn that bulk save groups inserts/updates by type
Users who pass many different object types to bulk_save_objects
may be surprised that the INSERT/UPDATE batches must necessarily
be broken up by type. Add this to the list of caveats.
Co-authored-by: Mike Bayer
Change-Id: I8390c1c971ced50c41268b479a9dcd09c695b135
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/294
(cherry picked from commit ce1492ef3aae692a3dc10fff400e178e7b2edff8)
Mike Bayer [Sun, 24 Jul 2016 21:37:25 +0000 (17:37 -0400)]
Allow Table._reset_exported to silently pass
Fixed bug in :class:`.Table` where the internal method
``_reset_exported()`` would corrupt the state of the object. This
method is intended for selectable objects and is called by the ORM
in some cases; an erroneous mapper configuration would could lead the
ORM to call this on on a :class:`.Table` object.
Mark Hahnenberg [Tue, 12 Jul 2016 18:07:52 +0000 (14:07 -0400)]
Fix issue with unbaking subqueries
Fix improper capture of a loop variable inside a lambda during unbaking
of subquery eager loaders, which would cause the incorrect query
to be invoked.