Commit Graph

10240 Commits

Author SHA1 Message Date
Mike Bayer bc705e28cf make this rule automatic based on coverage plugin 2013-07-03 13:48:05 -04:00
Mike Bayer 167adac5dc for this test, apparently we don't handle sets as unordered since neither does
MySQL.  for some reason set ordering was constant when testing mysqldb, but not
so with oursql.
2013-07-02 20:35:01 -04:00
Mike Bayer ae7ac4f73a add a float exclusion to help oursql build 100% 2013-07-02 18:43:30 -04:00
Mike Bayer b1e1bf8e67 Fixed bug when using multi-table UPDATE where a supplemental
table is a SELECT with its own bound parameters, where the positioning
of the bound parameters would be reversed versus the statement
itself when using MySQL's special syntax.
[ticket:2768]
2013-07-02 18:24:58 -04:00
Mike Bayer 1fb6c4a33d Added :class:.BIGINT to the list of type names that can be
reflected by the SQLite dialect; courtesy Russell Stuart.
[ticket:2764]
2013-07-02 18:10:08 -04:00
Mike Bayer 0e219f2eff ORM descriptors such as hybrid properties can now be referenced
by name in a string argument used with ``order_by``,
``primaryjoin``, or similar in :func:`.relationship`,
in addition to column-bound attributes. [ticket:2761]
2013-07-02 18:02:20 -04:00
Mike Bayer faa2b43c6c profile tweak 2013-07-02 15:33:00 -04:00
Mike Bayer 716067531b see also 2013-07-02 13:53:01 -04:00
Mike Bayer 96c98b32f5 - distribute/setuptools all over the place right now 2013-07-02 13:46:04 -04:00
Mike Bayer d3d10c982c - refactor pool a bit so that intent between ConnectionRecord/ConnectionFairy is clear;
make sure that the DBAPI connection passed to the reset-on-return events/dialect hooks
is also a "fairy", so that dictionaries like "info" are available.  [ticket:2770]
- rework the execution_options system so that the dialect is given the job of making
any immediate adjustments based on a set event.  move the "isolation level" logic to use
this new system.   Also work things out so that even engine-level execution options
can be used for things like isolation level; the dialect attaches a connect-event
handler in this case to handle the task.
- to support this new system as well as further extensibiltiy of execution options
add events engine_connect(), set_connection_execution_options(), set_engine_execution_options()
2013-07-02 13:14:21 -04:00
Mike Bayer 38c5e870a7 mark the tests that seem to be segfauling py3k+coverage so that we can exclude them
at the nose command line
2013-06-30 23:55:32 -04:00
Mike Bayer 1eaa003e02 fix syntax screwup 2013-06-30 20:15:21 -04:00
Mike Bayer 868da0c281 Added new flag `retaining=False` to the kinterbasdb and fdb dialects.
This controls the value of the ``retaining`` flag sent to the
``commit()`` and ``rollback()`` methods of the DBAPI connection.
Defaults to False.  Also in 0.8.2, where it defaults to True.
[ticket:2763]
2013-06-30 19:48:48 -04:00
Mike Bayer b38a76cd1d - replace most explicitly-named test objects called "Mock..." with
actual mock objects from the mock library.  I'd like to use mock
for new tests so we might as well use it in obvious places.
- use unittest.mock in py3.3
- changelog
- add a note to README.unittests
- add tests_require in setup.py
- have tests import from sqlalchemy.testing.mock
- apply usage of mock to one of the event tests.  we can be using
this approach all over the place.
2013-06-30 18:35:12 -04:00
Mike Bayer 715d6cf3d1 - additional fix for [ticket:2750] where on an update, we make sure the
value is present
2013-06-30 15:58:50 -04:00
Mike Bayer 6ece305692 add better tests for [ticket:2750] 2013-06-30 11:21:43 -04:00
Mike Bayer 3b24ccaf28 A warning is emitted when trying to flush an object of an inherited
mapped class where the polymorphic discriminator has been assigned
to a value that is invalid for the class.   [ticket:2750]
2013-06-30 11:09:37 -04:00
Mike Bayer 278c243aa3 tweak the timings here to maximize chance of test success 2013-06-29 11:17:32 -04:00
Mike Bayer 3dde982171 set UTC timezone on the connection here so we can get consistent results 2013-06-29 11:08:07 -04:00
Mike Bayer d875f677a3 The behavior of :func:.extract has been simplified on the
Postgresql dialect to no longer inject a hardcoded ``::timestamp``
or similar cast into the given expression, as this interfered
with types such as timezone-aware datetimes, but also
does not appear to be at all necessary with modern versions
of psycopg2.  Also in 0.8.2.
[ticket:2740]
2013-06-28 23:53:27 -04:00
Mike Bayer 1c23741b8e refactor test suites for postgresql, mssql, mysql into packages. 2013-06-28 22:30:11 -04:00
Mike Bayer 83f3dbc83d improve the close handling here so that we don't double-close a connection;
we log this now so it apparently happens a bunch
2013-06-28 22:29:45 -04:00
Mike Bayer bccf8ff5b1 Type lookup when reflecting the Firebird types LONG and
INT64 has been fixed so that LONG is treated as INTEGER,
INT64 treated as BIGINT, unless the type has a "precision"
in which case it's treated as NUMERIC.  Patch courtesy
Russell Stuart.
[ticket:2757]
2013-06-28 11:49:41 -04:00
Mike Bayer 04b66bc5e7 Fixed bug in HSTORE type where keys/values that contained
backslashed quotes would not be escaped correctly when
using the "non native" (i.e. non-psycopg2) means
of translating HSTORE data.  Patch courtesy Ryan Kelly.
[ticket:2766]
2013-06-28 11:35:57 -04:00
Mike Bayer fc348366f7 - fix a regression caused by #2587, where query.join() would apply an
adapter to an aliased-mapped, non-polymorphic selectable that prevented us from referring
directly to that selectable.
2013-06-27 16:43:01 -04:00
Mike Bayer 3e52710a79 add an ORDER BY here 2013-06-26 15:03:50 -04:00
Mike Bayer f76e65727d Merge branch 'ticket_2746'
Conflicts:
	doc/build/changelog/changelog_08.rst
	doc/build/changelog/changelog_09.rst
2013-06-26 13:24:07 -04:00
Mike Bayer f76cae4bc9 - rework of correlation, continuing on #2668, #2746
- add support for correlations to propagate all the way in; because
correlations require context now, need to make sure a select enclosure
of any level takes effect any number of levels deep.
- fix what we said correlate_except() was supposed to do when we first
released #2668 - "the FROM clause is left intact if the correlated SELECT
is not used in the context of an enclosing SELECT..." - it was not
considering the "existing_froms" collection at all, and prohibited
additional FROMs from being placed in an any() or has().
- add test for multilevel any()
- lots of docs, including glossary entries as we really need to define
"WHERE clause", "columns clause" etc. so that we can explain correlation better
- based on the insight that a SELECT can correlate anything that ultimately
came from an enclosing SELECT that links to this one via WHERE/columns/HAVING/ORDER BY,
have the compiler keep track of the FROM lists that correspond in this way,
link it to the asfrom flag, so that we send to _get_display_froms() the exact
list of candidate FROMs to correlate.  no longer need any asfrom logic in the
Select() itself
- preserve 0.8.1's behavior for correlation when no correlate options are given, not
to mention 0.7 and prior's behavior of not propagating implicit correlation more than one level..
this is to reduce surprises/hard-to-debug situations when a user isn't trying
to correlate anything.
2013-06-26 13:19:45 -04:00
Mike Bayer ef6245a3ca changelog 2013-06-26 11:37:55 -04:00
mike bayer 5b3b4750e0 Merge pull request #13 from malor/fix_indexes_reflection
Fix indexes reflection in PostgreSQL
2013-06-26 08:36:02 -07:00
mike bayer 51aec4f4c8 Merge pull request #12 from cjw296/master
Range type docs improvements.
2013-06-26 08:15:44 -07:00
Chris Withers fb469dfb24 Tidy range types docs and add warning about the return type support offered by different versions of different DBAPI libraries. 2013-06-26 07:29:48 +01:00
Chris Withers 110877cf14 Fix NameError in example. 2013-06-26 07:22:13 +01:00
Roman Podolyaka 0333ee23d3 Fix indexes reflection in PostgreSQL
Reflection of indexes must preserve the order of columns.

Fixes issue 2767.
2013-06-26 08:31:33 +03:00
Mike Bayer 1144704180 YEAR(2) emits a warning and oursql / mysqlconnector throw an exception
on the warning so just dump it
2013-06-23 20:13:28 -04:00
Mike Bayer 2f747e0ad2 docs 2013-06-23 19:32:54 -04:00
Mike Bayer dff5e56e95 doc fixes 2013-06-23 19:03:43 -04:00
Mike Bayer ff722f541f 0.8 changelog 2013-06-23 17:55:54 -04:00
Mike Bayer b6bbde360b 0.9 changelog 2013-06-23 17:55:26 -04:00
Mike Bayer 786c5fe316 - add a test for pullreq 8
- simplify
2013-06-23 17:53:49 -04:00
Mike Bayer 1f42aca571 Merge branch 'master' of https://github.com/asldevi/sqlalchemy into some_branch 2013-06-23 17:48:28 -04:00
Mike Bayer 2c33e2b59b sort here so that exception messages are testable 2013-06-23 17:30:54 -04:00
Mike Bayer 28a3f15206 tweak this for now, would need a test 2013-06-23 16:08:01 -04:00
Mike Bayer e288aff8ea The resolution of :class:.ForeignKey objects to their
target :class:`.Column` has been reworked to be as
immediate as possible, based on the moment that the
target :class:`.Column` is associated with the same
:class:`.MetaData` as this :class:`.ForeignKey`, rather
than waiting for the first time a join is constructed,
or similar. This along with other improvements allows
earlier detection of some foreign key configuration
issues.  Also included here is a rework of the
type-propagation system, so that
it should be reliable now to set the type as ``None``
on any :class:`.Column` that refers to another via
:class:`.ForeignKey` - the type will be copied from the
target column as soon as that other column is associated,
and now works for composite foreign keys as well.
[ticket:1765]
2013-06-23 15:58:07 -04:00
Mike Bayer 977678a773 ticket #1443 is for unique constraint reflection 2013-06-23 11:32:34 -04:00
mike bayer 907b5f72dd Merge pull request #11 from malor/fix_uc_reflection
Fix unique constraints reflection in SQLite and PostgreSQL
2013-06-23 08:31:57 -07:00
mike bayer c890ce8913 Merge pull request #10 from malor/fix_unicode_literals
Fix unicode literals on Python 3.1 and 3.2
2013-06-23 08:29:06 -07:00
Roman Podolyaka 3a80bf0d50 Fix unique constraints reflection in PostgreSQL
Reflection of unique constraints must preserve the order of columns.
2013-06-23 13:35:19 +03:00
Roman Podolyaka 25b4637bcd Fix unicode literals on Python 3.1 and 3.2
A few tests use u'' unicode literals which are not
supported in Python versions 3.1 and 3.2.
2013-06-23 12:57:53 +03:00
Roman Podolyaka 1ad06ea42c Fix unique constraints reflection in SQLite
If SQLite keywords are used as column names, they are
quoted. The code parsing the information about table
unique constraints should be modified so that it properly
removes double-quotes from column names.
2013-06-23 10:42:03 +03:00