Commit Graph

10240 Commits

Author SHA1 Message Date
Mike Bayer b4d9795db1 - dont need this import and it's not in 2.6 anyway 2014-02-17 16:03:07 -05:00
Mike Bayer 88c23b8df2 ill never remember this URL so put it here
e Please enter the commit message for your changes. Lines starting
2014-02-17 14:54:38 -05:00
Mike Bayer 00c6ebb440 - rewrite SQLite reflection tests into one consistent fixture, which tests
both _resolve_type_affinity() directly as well as round trip tests fully.
2014-02-16 18:14:10 -05:00
Mike Bayer 5bc3b7fe6b - need qualifiers here... 2014-02-16 17:20:35 -05:00
Mike Bayer 5e100a70c5 - The SQLite dialect will now skip unsupported arguments when reflecting
types; such as if it encounters a string like ``INTEGER(5)``, the
:class:`.INTEGER` type will be instantiated without the "5" being included,
based on detecting a ``TypeError`` on the first attempt.
2014-02-16 17:20:18 -05:00
Mike Bayer 79f801eae8 - changelog + documentation for pullreq github:65 2014-02-16 17:10:05 -05:00
Mike Bayer 198a900bd1 Merge branch 'master' of https://github.com/eblume/sqlalchemy into t 2014-02-16 16:43:42 -05:00
Mike Bayer 937e81be16 - changelog for pullreq github:64 2014-02-16 16:41:36 -05:00
mike bayer d54ba44c2c Merge pull request #64 from LevonXXL/master
python_type for ARRAY (PGArray)
2014-02-16 16:40:04 -05:00
Mike Bayer 4588a0e603 - use column.info to detect those cols part of "versioning"
- pep8 cleanup
- fix tests for "changed" column
- document that "changed" is optional
- changelog
2014-02-16 16:38:09 -05:00
Mike Bayer 4dd7bf58c0 Merge branch 'patch-1' of https://github.com/jplaverdure/sqlalchemy into t 2014-02-16 16:23:54 -05:00
Mike Bayer a79efa2aa4 this isn't really the mainstream use case here; would need to talk
about non-equality operators in general.
2014-02-16 14:43:26 -05:00
Mike Bayer 1921e7a3cb - extensive cross-linking of relationship options with their documentation sections
- convert all paramter references in relationship documentation to :paramref:
2014-02-16 14:28:56 -05:00
Mike Bayer 945b87b2d8 remove redundant see also 2014-02-16 12:47:43 -05:00
Mike Bayer 9d5188b192 - add cross-linking for passive_deletes / passive_updates 2014-02-16 12:43:46 -05:00
Mike Bayer c3b1b55408 - add documentation regarding native hstore flag, psycopg2
hstore extension. #2959
2014-02-16 12:03:00 -05:00
Mike Bayer 70ed9c8b55 - expand docs on MySQL table arguments beyond just storage engines
- clarify section on "foreign key reflection" and group this in a
section that refers to foreign keys.
2014-02-15 20:51:38 -05:00
Mike Bayer 17ecf15a3b - cross link remote_side/self-referential
- trim off fn prefix on some relationship parameter names
2014-02-14 15:45:18 -05:00
Mike Bayer 28229a35e0 - Added server version detection to the newly added dialect startup
query for  "show standard_conforming_strings"; as this variable was
added as of PG 8.2, we skip the query for PG versions older than
that as well as for backends like Redshift. #2946
2014-02-14 14:39:41 -05:00
Mike Bayer 5330c02b72 this is for 0.9.3 also 2014-02-14 14:36:06 -05:00
Mike Bayer ffa6f45ec3 - Revised this very old issue where the Postgresql "get primary key"
reflection query were updated to take into account primary key constraints
that were renamed; the newer query fails on very old versions of
Postgresql such as version 7, so the old query is restored in those cases
when server_version_info < (8, 0) is detected. #2291
2014-02-14 14:32:00 -05:00
Marcus McCurdy c597843f13 Fixes MySQL dialect partitioning 2014-02-14 13:23:51 -05:00
Mike Bayer 3e7caad3cf - use an OrderedDict here so that tests are more deterministic 2014-02-14 13:17:58 -05:00
Mike Bayer 036cb93abf - Fixed bug where :meth:.in_() would go into an endless loop if
erroneously passed a column expression whose comparator included
the ``__getitem__()`` method, such as a column that uses the
:class:`.postgresql.ARRAY` type. [ticket:2957]
2014-02-13 15:19:12 -05:00
Mike Bayer 4a79bc578c - Fixed bug where :class:.AbstractConcreteBase would fail to be
fully usable within declarative relationship configuration, as its
string classname would not be available in the registry of classnames
at mapper configuration time.   The class now explicitly adds itself
to the class regsitry, and additionally both :class:`.AbstractConcreteBase`
as well as :class:`.ConcreteBase` set themselves up *before* mappers
are configured within the :func:`.configure_mappers` setup, using
the new :meth:`.MapperEvents.before_configured` event. [ticket:2950]

- Added new :meth:`.MapperEvents.before_configured` event which allows
an event at the start of :func:`.configure_mappers`, as well
as ``__declare_first__()`` hook within declarative to complement
``__declare_last__()``.

- modified how after_configured is invoked; we just make a dispatch()
not actually connected to any mapper.  this makes it easier
to also invoke before_configured correctly.

- improved the ComparableEntity fixture to handle collections that are sets.
2014-02-11 19:55:34 -05:00
Mike Bayer 0050a8d3db - changelog for [ticket:2934] 2014-02-11 18:00:10 -05:00
mike bayer c036cca67e Merge pull request #69 from sloat/pr2934
Fixes server version parsing in cymysql dialect
2014-02-11 17:57:40 -05:00
Matt (work) bd98bd5fff Parse server version info more robustly
Closes #2934
2014-02-11 17:26:03 -05:00
Mike Bayer bf934018a5 - for TextAsFrom, put the "inner" columns in the result map directly.
Have also considered linking column.label() to the "column" itself being
in the result map but this reveals some naming collision problems (that
also seem to be very poorly tested...).   This should be as far as
we want to go right now with [ticket:2932].
2014-02-10 19:17:00 -05:00
Mike Bayer 7d56f6c807 this example doesn't work, we don't really have a solution for this as far as automating this pattern 2014-02-10 17:43:37 -05:00
Mike Bayer 093ce65c5f - dont need these extra conditions from the previous test 2014-02-10 16:37:32 -05:00
Mike Bayer 2a25e42c08 - Fixed bug where :meth:.Query.get would fail to consistently
raise the :class:`.InvalidRequestError` that invokes when called
on a query with existing criterion, when the given identity is
already present in the identity map. [ticket:2951]
2014-02-10 16:33:48 -05:00
Mike Bayer ab738c21aa - Fixed an 0.9 regression where ORM instance or mapper events applied
to a base class such as a declarative base with the propagate=True
flag would fail to apply to existing mapped classes which also
used inheritance due to an assertion.  Addtionally, repaired an
attribute error which could occur during removal of such an event,
depending on how it was first assigned. [ticket:2949]
2014-02-09 16:47:20 -05:00
Mike Bayer ee88e648f7 - Fixed bug where the :class:.AutomapBase class of the
new automap extension would fail if classes
were pre-arranged in single or potentially joined inheritance patterns.
The repaired joined inheritance issue could also potentially apply when
using :class:`.DeferredReflection` as well.
2014-02-08 21:24:13 -05:00
Kevin Deldycke cf4e421248 Add unit test for UUID arrays in PostgreSQL. 2014-02-06 11:44:52 +01:00
Mike Bayer 5c188f6c1c - More issues with [ticket:2932] first resolved in 0.9.2 where
using a column key of the form ``<tablename>_<columnname>``
matching that of an aliased column in the text would still not
match at the ORM level, which is ultimately due to a core
column-matching issue.  Additional rules have been added so that the
column ``_label`` is taken into account when working with a
:class:`.TextAsFrom` construct or with literal columns.
[ticket:2932]
2014-02-05 19:25:13 -05:00
Mike Bayer c5dccd82da - Fixed regression in new "naming convention" feature where conventions
would fail if the referred table in a foreign key contained a schema
name.  Pull request courtesy Thomas Farvour. pullreq github:67
2014-02-05 16:54:31 -05:00
Tom Farvour d006198e17 Add naming convention support when using schema in the metadata. 2014-02-05 15:40:55 -06:00
Mike Bayer 16cd07c4f8 - Fixed bug where so-called "literal render" of :func:.bindparam
constructs would fail if the bind were constructed with a callable,
rather than a direct value.  This prevented ORM expressions
from being rendered with the "literal_binds" compiler flag.
2014-02-05 12:03:46 -05:00
Erich Blume e47f994503 SQLite dialect - support relection from affinity
SQLite allows column types that aren't technically understood in sqlite
by using 'data affinity', which is an algorithm for converting column
types in to some sort of useful type that can be stored and retrieved
from the db. Unfortunatly, this breaks reflection since we (previously)
expected a sqlite db to reflect column types that we permit in the
`ischema_names` for that dialect.

This patch changes the logic for 'unknown' column types during
reflection to instead run through SQLite's data affinity algorithm, and
assigns appropriate types from that.

It also expands the matching for column type to include column types
with spaces (strongly discouraged but allowed by sqlite) and also
completely empty column types (in which case the NullType is assigned,
which sqlite will treat as a Blob - or rather, Blob is treated as
NullType). These changes mean that SQLite will never raise an error for
an unknown type during reflection - there will always be some 'useful'
type returned, which follows the spirit of SQLite (accomodation before
sanity!).
2014-02-03 16:55:00 -08:00
Mike Bayer b069127b2d - Improved the initialization logic of composite attributes such that
calling ``MyClass.attribute`` will not require that the configure
mappers step has occurred, e.g. it will just work without throwing
any error. [ticket:2935]
2014-02-03 19:13:16 -05:00
Mike Bayer 69a66d58c2 0.9.3 2014-02-03 12:13:17 -05:00
Mike Bayer 7a9e8b2312 - this seems to be the best string for pymysql 2014-02-03 12:11:23 -05:00
Mike Bayer 8b08b1a35b - Fixed bug which prevented MySQLdb-based dialects (e.g.
pymysql) from working in Py3K, where a check for "connection
charset" would fail due to Py3K's more strict value comparison
rules.  The call in question  wasn't taking the database
version into account in any case as the server version was
still None at that point, so the method overall has been
simplified to rely upon connection.character_set_name().
[ticket:2933]
2014-02-03 12:04:51 -05:00
Terentev c7af5618dc python_type for ARRAY (PGArray) 2014-02-03 16:25:18 +04:00
Mike Bayer 37d1f8983c typo rel_0_9_2 2014-02-02 19:28:41 -05:00
Mike Bayer 064df1d1ee 0.9.2 2014-02-02 19:19:24 -05:00
Mike Bayer b85f0b5681 - Added a tweak to the "history_meta" example where the check for
"history" on a relationship-bound attribute will now no longer emit
any SQL if the relationship is unloaded.
2014-02-02 19:05:36 -05:00
Mike Bayer 1b8a495767 - add a few missing methods to the cymysql dialect 2014-02-02 18:20:16 -05:00
Mike Bayer 4b39670875 - lets intersphinx the new alembic article on constraint names 2014-02-02 18:01:59 -05:00