Commit Graph

2344 Commits

Author SHA1 Message Date
Mike Bayer baabf3bedb - typo
(cherry picked from commit b53667526e)
2016-01-20 14:03:49 -05:00
Mike Bayer 632c4f21fa - redo the docs for concrete inheritance to more strongly
favor declarative, fixes #2890
2016-01-20 13:34:57 -05:00
Mike Bayer 02271efd89 - clarify the "Adding" section also illustrates updates, fixes #2942 2016-01-20 12:22:17 -05:00
Mike Bayer 39837686b0 - calling str() on a core sql construct has been made more "friendly",
when the construct contains non-standard sql elements such as
returning, array index operations, or dialect-specific or custom
datatypes.  a string is now returned in these cases rendering an
approximation of the construct (typically the postgresql-style
version of it) rather than raising an error. fixes #3631
- add within_group to top-level imports
- add eq_ignore_whitespace to sqlalchemy.testing imports
2016-01-19 16:47:16 -05:00
Mike Bayer b7bc704f3d - Fixed issue where two same-named relationships that refer to
a base class and a concrete-inherited subclass would raise an error
if those relationships were set up using "backref", while setting up the
identical configuration using relationship() instead with the conflicting
names would succeed, as is allowed in the case of a concrete mapping.
fixes #3630
2016-01-19 13:34:42 -05:00
Mike Bayer 2a7f37b7b0 - The `str() call for :class:.Query` will now take into account
the :class:`.Engine` to which the :class:`.Session` is bound, when
generating the string form of the SQL, so that the actual SQL
that would be emitted to the database is shown, if possible.  Previously,
only the engine associated with the :class:`.MetaData` to which the
mappings are associated would be used, if present.  If
no bind can be located either on the :class:`.Session` or on
the :class:`.MetaData` to which the mappings are associated, then
the "default" dialect is used to render the SQL, as was the case
previously.  fixes #3081
2016-01-19 12:44:42 -05:00
Mike Bayer d4d9a65248 - Fixed bug where some exception re-raise scenarios would attach
the exception to itself as the "cause"; while the Python 3 interpreter
is OK with this, it could cause endless loops in iPython.
fixes #3625
- add tests for reraise, raise_from_cause
- raise_from_cause is the same on py2k/3k, use just one function
2016-01-18 17:35:44 -05:00
Mike Bayer b985483c59 Merge remote-tracking branch 'origin/pr/227' 2016-01-16 22:06:29 -05:00
Mike Bayer 66560cef74 - fix People -> Person , fixes #3628 2016-01-16 22:04:10 -05:00
rmn f9b2185586 Fix typo in relationships docs 2016-01-16 21:19:02 +03:00
Mike Bayer a7cc296714 - update 2016-01-14 18:21:23 -05:00
Mike Bayer 7bb578b1bd - illustrate these using the newer exception doctest format.
unfortunately we can't show the SQL unless we filtered it out
from doctest...not worth it
2016-01-14 18:20:00 -05:00
Mike Bayer 1f7a1f777d - A deep improvement to the recently added :meth:.TextClause.columns
method, and its interaction with result-row processing, now allows
the columns passed to the method to be positionally matched with the
result columns in the statement, rather than matching on name alone.
The advantage to this includes that when linking a textual SQL statement
to an ORM or Core table model, no system of labeling or de-duping of
common column names needs to occur, which also means there's no need
to worry about how label names match to ORM columns and so-forth.  In
addition, the :class:`.ResultProxy` has been further enhanced to
map column and string keys to a row with greater precision in some
cases.  fixes #3501
- reorganize the initialization of ResultMetaData for readability
and complexity; use the name "cursor_description", define the
task of "merging" cursor_description with compiled column information
as its own function, and also define "name extraction" as a separate task.
- fully change the name we use in the "ambiguous column" error to be the
actual name that was ambiguous, modify the C ext also
2016-01-14 18:06:26 -05:00
Mike Bayer 215167d8d3 - changelog for pr bitbucket:70, fixes #3624 2016-01-12 09:53:09 -05:00
Mike Bayer d03477d4b7 - fix link to types in metadata, fixes #3618
- fix "version" got whacked into "f" in core tutorial
- fix short underline in automap
- fix unmatched boldface in session events
2016-01-10 11:48:53 -05:00
Mike Bayer ddba8b0e7f Merge remote-tracking branch 'origin/pr/225' 2016-01-10 10:31:51 -05:00
Adrian Moennich bb29449755 Fix typo in session docs 2016-01-09 20:35:19 +01:00
Mike Bayer c7ae0daf0e - Fixed regression since 0.9 where the 0.9 style loader options
system failed to accommodate for multiple :func:`.undefer_group`
loader options in a single query.   Multiple :func:`.undefer_group`
options will now be taken into account even against the same
entity. fixes #3623
2016-01-09 10:10:20 -05:00
Mike Bayer 89facbed88 - Multi-tenancy schema translation for :class:.Table objects is added.
This supports the use case of an application that uses the same set of
:class:`.Table` objects in many schemas, such as schema-per-user.
A new execution option
:paramref:`.Connection.execution_options.schema_translate_map` is
added. fixes #2685
- latest tox doesn't like the {posargs} in the profile rerunner
2016-01-08 22:12:25 -05:00
Mike Bayer c8b7729338 - Added a new entrypoint system to the engine to allow "plugins" to
be stated in the query string for a URL.   Custom plugins can
be written which will be given the chance up front to alter and/or
consume the engine's URL and keyword arguments, and then at engine
create time will be given the engine itself to allow additional
modifications or event registration.  Plugins are written as a
subclass of :class:`.CreateEnginePlugin`; see that class for
details.
fixes #3536
2016-01-06 17:20:57 -05:00
Mike Bayer a80bb4e5aa - Added :class:.mysql.JSON for MySQL 5.7. The JSON type provides
persistence of JSON values in MySQL as well as basic operator support
of "getitem" and "getpath", making use of the ``JSON_EXTRACT``
function in order to refer to individual paths in a JSON structure.
fixes #3547
- Added a new type to core :class:`.types.JSON`.  This is the
base of the PostgreSQL :class:`.postgresql.JSON` type as well as that
of the new :class:`.mysql.JSON` type, so that a PG/MySQL-agnostic
JSON column may be used.  The type features basic index and path
searching support.
fixes #3619
- reorganization of migration docs etc. to try to refer both to
the fixes to JSON that helps Postgresql while at the same time
indicating these are new features of the new base JSON type.
- a rework of the Array/Indexable system some more, moving things
that are specific to Array out of Indexable.
- new operators for JSON indexing added to core so that these can
be compiled by the PG and MySQL dialects individually
- rename sqltypes.Array to sqltypes.ARRAY - as there is no generic
Array implementation, this is an uppercase type for now, consistent
with the new sqltypes.JSON type that is also not a generic implementation.
There may need to be some convention change to handle the case of
datatypes that aren't generic, rely upon DB-native implementations,
but aren't necessarily all named the same thing.
2016-01-06 12:47:48 -05:00
Mike Bayer 16746dd1a6 - dont forwards-report tons of 1.0.x changes in the unreleased 1.1;
only when a 1.1.x is released would we want to capture what's still
sitting in a 1.0.x changelog
2016-01-05 15:12:56 -05:00
Mike Bayer 197ffa2be2 - Fixed 1.0 regression where the eager fetch of cursor.rowcount was
no longer called for an UPDATE or DELETE statement emitted via plain
text or via the :func:`.text` construct, affecting those drivers
that erase cursor.rowcount once the cursor is closed such as SQL
Server ODBC and Firebird drivers.
fixes #3622
2016-01-05 10:25:36 -05:00
Jeff Widman 56b76ce7a8 Update SQLAlchemy-Migrate link to the new repo 2015-12-24 02:17:02 -08:00
Mike Bayer c7d6c667b5 - Fixed an assertion that would raise somewhat inappropriately
if a :class:`.Index` were associated with a :class:`.Column` that
is associated with a lower-case-t :class:`.TableClause`; the
association should be ignored for the purposes of associating
the index with a :class:`.Table`.
fixes #3616
2015-12-23 22:59:44 -05:00
Mike Bayer 93b48e6aba - release date for 1.0.11 2015-12-22 20:50:38 -05:00
Mike Bayer 8c54b14b5c - An adjustment to the regular expression used to parse MySQL views,
such that we no longer assume the "ALGORITHM" keyword is present in
the reflected view source, as some users have reported this not being
present in some Amazon RDS environments.
fixes #3613
2015-12-22 12:04:45 -05:00
Mike Bayer 5c7ade2f42 - changelog for pullreq github:222 2015-12-22 11:56:02 -05:00
Mike Bayer 913858c949 - Further fixes to 🎫3605, pop method on :class:.MutableDict,
where the "default" argument was not included.
fixes #3605
2015-12-17 11:24:35 -05:00
Jeff Widman 30be49c157 Make docs listing of param order for event.listen match the code 2015-12-17 05:54:50 -08:00
jonathan vanasco 738d515b95 some spelling fixes 2015-12-16 11:12:07 -05:00
Mike Bayer a22b208506 - Fixed bug in baked loader system where the systemwide monkeypatch
for setting up baked lazy loaders would interfere with other
loader strategies that rely on lazy loading as a fallback, e.g.
joined and subquery eager loaders, leading to ``IndexError``
exceptions at mapper configuration time.
fixes #3612
2015-12-15 21:44:00 -05:00
Mike Bayer 8a24da6c10 - hyperlink default-related parameters
(cherry picked from commit 9f6f34bc8f)
2015-12-15 18:31:56 -05:00
Mike Bayer a8ec349198 - Fixed regression caused in 1.0.10 by the fix for 🎫3593 where
the check added for a polymorphic joinedload from a
poly_subclass->class->poly_baseclass connection would fail for the
scenario of class->poly_subclass->class.
fixes #3611
2015-12-15 14:00:50 -05:00
Mike Bayer 80bbf13959 - a few tweaks to allow "server_defaults" to be a little more linkable;
remove "undoc members" that was putting some random server_default
atributes from ColumnClause

(cherry picked from commit 270301890a)
2015-12-14 18:02:14 -05:00
Mike Bayer 26ed90ab22 - Fixed bug where :meth:.Session.bulk_update_mappings and related
would not bump a version id counter when in use.  The experience
here is still a little rough as the original version id is required
in the given dictionaries and there's not clean error reporting
on that yet.
fixes #3610
2015-12-14 17:39:50 -05:00
Mike Bayer 0e4c4d7efc - Fixed bug in :meth:.Update.return_defaults which would cause all
insert-default holding columns not otherwise included in the SET
clause (such as primary key cols) to get rendered into the RETURNING
even though this is an UPDATE.

- Major fixes to the :paramref:`.Mapper.eager_defaults` flag, this
flag would not be honored correctly in the case that multiple
UPDATE statements were to be emitted, either as part of a flush
or a bulk update operation.  Additionally, RETURNING
would be emitted unnecessarily within update statements.

fixes #3609
2015-12-14 17:30:21 -05:00
Mike Bayer 7d96ad4d53 - Fixed bug where use of the :meth:.Query.select_from method would
cause a subsequent call to the :meth:`.Query.with_parent` method to
fail. fixes #3606
- add mark-as-fail test for #3607
2015-12-12 21:08:56 -05:00
Mike Bayer d67d04c70a 1.0.10
(cherry picked from commit 6b87e0b301)
2015-12-11 16:05:41 -05:00
Mike Bayer 5710a1e88b - Added support for the `dict.pop() and dict.popitem()` methods
to the :class:`.mutable.MutableDict` class.
fixes #3605
2015-12-11 11:21:46 -05:00
Mike Bayer 741b8af31b - convert ORM tutorial and basic_relationships to favor
back_populates while still maintaining great familiarity
w/ backref so as not to confuse people.  fixes #3390
2015-12-10 18:27:14 -05:00
Mike Bayer d533b8e922 - The ORM and Core tutorials, which have always been in doctest format,
are now exercised within the normal unit test suite in both Python
2 and Python 3.
- remove the old testdocs.py runner and replace with test/base/test_tutorials.py
- use pytest's unicode fixer so that we can test for unicode strings
in both py2k/3k
- use py3k format overall for prints, exceptions
- add other fixers to guarantee deterministic results
- add skips and ellipses to outputs that aren't worth matching
2015-12-10 17:09:47 -05:00
Mike Bayer e57bf79616 - Fixed issue within the :meth:.Insert.from_select construct whereby
the :class:`.Select` construct would have its ``._raw_columns``
collection mutated in-place when compiling the :class:`.Insert`
construct, when the target :class:`.Table` has Python-side defaults.
The :class:`.Select` construct would compile standalone with the
erroneous column present subsequent to compilation of the
:class:`.Insert`, and the the :class:`.Insert` statement itself would
fail on a second compile attempt due to duplicate bound parameters.
fixes #3603
2015-12-09 18:15:25 -05:00
Mike Bayer f4a1129e79 - fix changelog for #3602
- add version switch for backend fsp test

(cherry picked from commit 67b22cee3a)
2015-12-08 13:50:25 -05:00
Mike Bayer 3f42743d6a - Fixed bug in MySQL reflection where the "fractional sections portion"
of the :class:`.mysql.DATETIME`, :class:`.mysql.TIMESTAMP` and
:class:`.mysql.TIME` types would be incorrectly placed into the
``timestamp`` attribute, which is unused by MySQL, instead of the
``fsp`` attribute.
fixes #3602
2015-12-07 17:24:09 -05:00
Mike Bayer 3ec9b9f6b6 - The :meth:.Session.merge method now tracks pending objects by
primary key before emitting an INSERT, and merges distinct objects with
duplicate primary keys together as they are encountered, which is
essentially semi-deterministic at best.   This behavior
matches what happens already with persistent objects.
fixes #3601
2015-12-04 11:52:16 -05:00
Mike Bayer 935bc34dc5 - Fixed issue where post_update on a many-to-one relationship would
fail to emit an UPDATE in the case where the attribute were set to
None and not previously loaded.
fixes #3599
2015-12-02 12:13:57 -05:00
Mike Bayer 9695faf329 - Fixed bug where CREATE TABLE with a no-column table, but a constraint
such as a CHECK constraint would render an erroneous comma in the
definition; this scenario can occur such as with a Postgresql
INHERITS table that has no columns of its own.
fixes #3598
2015-12-01 19:03:03 -05:00
Mike Bayer ab69467697 - Added the error "20006: Write to the server failed" to the list
of disconnect errors for the pymssql driver, as this has been observed
to render a connection unusable.
fixes #3585
2015-11-30 13:15:40 -05:00
Mike Bayer f4cb3f8cac - changelog for #3573, fixes #3573 2015-11-30 13:06:11 -05:00