Commit Graph

8856 Commits

Author SHA1 Message Date
Mike Bayer 4100f9c06e - remove nose dependency 2014-03-26 14:42:51 -04:00
Mike Bayer 1a35188b69 - Fixed regression caused by release 0.8.5 / 0.9.3's compatibility
enhancements where index reflection on Postgresql versions specific
to only the 8.1, 8.2 series again
broke, surrounding the ever problematic int2vector type.  While
int2vector supports array operations as of 8.1, apparently it only
supports CAST to a varchar as of 8.3.
fix #3000
2014-03-25 12:26:42 -04:00
Mike Bayer 74f7509d66 add some more mock structure so tricky DBAPIs like pypy work 2014-03-24 19:30:44 -04:00
Mike Bayer 12c8a10b81 fix 2014-03-24 13:33:53 -04:00
Mike Bayer 50d19f55d2 - add some more rules to make sure all tests run if DBs are available 2014-03-24 12:49:22 -04:00
Mike Bayer 990266f551 fix some mysqlconnector failures 2014-03-24 12:12:26 -04:00
Mike Bayer 82a67abf4b - fix the uuid routine here to not run out of uuids 2014-03-24 11:57:38 -04:00
Mike Bayer 7e6a5e7946 - fix some doctest failures (though some remain, as it's not easy to get doctest
to accept things flexibly), fix #2999
2014-03-24 11:48:18 -04:00
Mike Bayer 2f150bee28 - rename __multiple__ to __backend__, and apply __backend__ to a large number of tests.
- move out logging tests from test_execute to test_logging
2014-03-24 11:33:53 -04:00
Mike Bayer 87d7076b49 - Added some new event mechanics for dialect-level events; the initial
implementation allows an event handler to redefine the specific mechanics
by which an arbitrary dialect invokes execute() or executemany() on a
DBAPI cursor.  The new events, at this point semi-public and experimental,
are in support of some upcoming transaction-related extensions.
2014-03-24 10:22:39 -04:00
Mike Bayer ebd24974f4 take out accidental PG dialect use here 2014-03-24 10:09:07 -04:00
Mike Bayer ae7e0a2721 some profile updates... 2014-03-23 21:39:17 -04:00
Mike Bayer 39a8e2ed37 - Fixed regression from 0.8.3 as a result of 🎫2818
where :meth:`.Query.exists` wouldn't work on a query that only
had a :meth:`.Query.select_from` entry but no other entities.
re: #2818 fixes #2995
2014-03-22 19:55:00 -04:00
Mike Bayer b00e15b50f - An event listener can now be associated with a :class:.Engine,
after one or more :class:`.Connection` objects have been created
(such as by an orm :class:`.Session` or via explicit connect)
and the listener will pick up events from those connections.
Previously, performance concerns pushed the event transfer from
:class:`.Engine` to  :class:`.Connection` at init-time only, but
we've inlined a bunch of conditional checks to make this possible
without any additional function calls. fixes #2978
2014-03-22 19:34:18 -04:00
Mike Bayer a7a6b43660 there's no "assert_call_count" on mock 2014-03-22 19:10:00 -04:00
Mike Bayer 8e10ab92df - restore the old behavior of the connection pool replacing itself just
within userland engine.dispose(); as some SQLA tests already failed when the replace step
was removed, due to those conns still being referenced, it's likely this will
create surprises for all those users that incorrectly use dispose()
and it's not really worth dealing with.  This doesn't affect the change
we made for ref: #2985.
2014-03-22 19:02:37 -04:00
Mike Bayer 5d2bfc4df4 - Fixed a few errant `u''` strings that would prevent tests from passing
in Py3.2.  Patch courtesy Arfrever Frehtes Taifersar Arahesis. fixes #2980
2014-03-22 18:48:59 -04:00
Mike Bayer eed9cfc3ae - A major improvement made to the mechanics by which the :class:.Engine
recycles the connection pool when a "disconnect" condition is detected;
instead of discarding the pool and explicitly closing out connections,
the pool is retained and a "generational" timestamp is updated to
reflect the current time, thereby causing all existing connections
to be recycled when they are next checked out.   This greatly simplifies
the recycle process, removes the need for "waking up" connect attempts
waiting on the old pool and eliminates the race condition that many
immediately-discarded "pool" objects could be created during the
recycle operation. fixes #2985
2014-03-22 18:45:39 -04:00
Mike Bayer be3c185fd4 - Added new datatype :class:.oracle.DATE, which is a subclass of
:class:`.DateTime`.  As Oracle has no "datetime" type per se,
it instead has only ``DATE``, it is appropriate here that the
``DATE`` type as present in the Oracle dialect be an instance of
:class:`.DateTime`.  This issue doesn't change anything as far as
the behavior of the type, as data conversion is handled by the
DBAPI in any case, however the improved subclass layout will help
the use cases of inspecting types for cross-database compatibility.
Also removed uppercase ``DATETIME`` from the Oracle dialect as this
type isn't functional in that context.  fixes #2987
2014-03-22 18:22:17 -04:00
Mike Bayer 56ef17e0f7 - we aren't supporting py2.5 so just simplify this import for platform, re: #2986 2014-03-22 17:49:35 -04:00
Mike Bayer ec97911ed9 - Adjusted `setup.py` file to support the possible future
removal of the ``setuptools.Feature`` extension from setuptools.
If this keyword isn't present, the setup will still succeed
with setuptools rather than falling back to distutils.  C extension
building can be disabled now also by setting the
DISABLE_SQLALCHEMY_CEXT environment variable.  This variable works
whether or not setuptools is even available. fixes #2986
- using platform.python_implementation() in setup.py to detect CPython.
I've tested this function on OSX and linux on Python 2.6 through 3.4,
including 3.1, 3.2, 3.3.
Unfortunately, on OSX + 3.2 only, it seems to segfault.  I've tried
installing 3.2.5 from the python.org .dmg, building it from source,
and also blew away the whole 3.2 directory, something seems to be wrong
with the "platform" module on that platform only, and there's also no
issue on bugs.python.org; however, I'm going with
it anyway. If someone is using 3.2 on OSX they really should be upgrading.
2014-03-22 17:31:50 -04:00
Mike Bayer c464960fdd changelog to fix #2988 2014-03-22 16:36:06 -04:00
Mike Bayer 8459c27273 Merge branch 'fix_table_registration' of https://github.com/malor/sqlalchemy into t 2014-03-22 16:34:51 -04:00
mike bayer 2b1c3d8821 Merge pull request #81 from tony/patch-2
Fix tag typo in changelog_09
2014-03-21 09:59:23 -04:00
Tony Narlock 07992a6697 Fix tag typo in changelog_09 2014-03-21 08:42:37 -05:00
Mike Bayer a22927b809 - reword the paragraph which talks about web framework integration for sessions:
1. fix the typo in the paragraph, fixes #2998
2. as zope-sqlalchemy only provides transaction integration and not session scoping,
dial back the language here as people are probably using scoped_session with pyramid anyway
3. as I'm going to again start recommending people don't cling to flask-sqlalchemy so hard,
take out the word "strongly" from the recommendation.
4. as flask is the only framework I can think of that actually has an explicit SQLAlchemy
layer that handles setting up scoped_session, take out the word "most", now it's "some web frameworks"
(by which it means "only flask...and flask-sqlalchemy is probably not worth using anyway")
2014-03-20 22:46:23 -04:00
Mike Bayer 2a1a79b6ce - The :meth:.ConnectionEvents.after_cursor_execute event is now
emitted for the "_cursor_execute()" method of :class:`.Connection`;
this is the "quick" executor that is used for things like
when a sequence is executed ahead of an INSERT statement, as well as
for dialect startup checks like unicode returns, charset, etc.
the :meth:`.ConnectionEvents.before_cursor_execute` event was already
invoked here.  The "executemany" flag is now always set to False
here, as this event always corresponds to a single execution.
Previously the flag could be True if we were acting on behalf of
an executemany INSERT statement.
2014-03-19 13:03:44 -04:00
Mike Bayer 89a8e0d187 fix assertion 2014-03-19 11:47:58 -04:00
Mike Bayer b9a2b58dd7 - Fixed bug in mutable extension as well as
:func:`.attributes.flag_modified` where the change event would not be
propagated if the attribute had been reassigned to itself.
fixes #2997
2014-03-19 11:09:38 -04:00
Mike Bayer fd8dbf8e78 Merge branch 'ca/dev/add_is_and_isnot_to_tutorial' of https://github.com/charlax/sqlalchemy 2014-03-17 17:27:21 -04:00
Mike Bayer 9ec01ab35a - Improved an error message which would occur if a query() were made
against a non-selectable, such as a :func:`.literal_column`, and then
an attempt was made to use :meth:`.Query.join` such that the "left"
side would be determined as ``None`` and then fail.  This condition
is now detected explicitly.
2014-03-17 16:25:51 -04:00
Mike Bayer e2214a61e8 typo 2014-03-16 14:51:06 -04:00
Mike Bayer fb09877270 - Added support for the not-quite-yet-documented `insert=True`
flag for :func:`.event.listen` to work with mapper / instance events.
2014-03-16 14:50:55 -04:00
Charles-Axel Dein fbfad42cb4 Add is_ and isnot filter to the tutorial
Most linter complain when comparing with None.
2014-03-15 14:42:43 -07:00
Mike Bayer 56e38b8e4e - fairly epic rework of the cascade documentation 2014-03-15 15:44:29 -04:00
Mike Bayer 6d0f734a3d - correct this to make the intention clear 2014-03-13 20:14:23 -04:00
Mike Bayer 11003828cb - Added support for literal rendering of boolean values, e.g.
"true" / "false" or "1" / "0".
- added Boolean tests to the test suite
2014-03-13 20:03:48 -04:00
Mike Bayer 9c5c12fb23 - move some requirements up to the testing module to better support running
SQLA internal tests outside; plus things like savepoints, twophase
2014-03-13 19:59:10 -04:00
Mike Bayer 2057b86b2a comment 2014-03-13 19:18:58 -04:00
Mike Bayer dd40c63885 - add a suite test for underscore as initial char 2014-03-13 19:05:22 -04:00
Mike Bayer 8433a48fab - add more support for suite tests, moving some tests from test_query out to suite
and adding some more requirements
2014-03-13 18:54:56 -04:00
Roman Podoliaka 0bb00db558 Remove tables from metadata when autoload fails
If autoloading of a table fails, don't register it in a metadata
instance. It seems that the original behaviour was accidentally
changed in f6198d9abf, restore it.

Closes issue #2988
2014-03-12 17:56:42 -07:00
Mike Bayer 36792434c7 - Added a new feature :func:.schema.conv, the purpose of which is to
mark a constraint name as already having had a naming convention applied.
This token will be used by Alembic migrations as of Alembic 0.6.4
in order to render constraints in migration scripts with names marked
as already having been subject to a naming convention.
re: #2991
2014-03-12 17:33:03 -04:00
Mike Bayer a7ef7eccaa :paramref:.MetaData.naming_convention feature will now also
apply to :class:`.CheckConstraint` objects that are associated
directly with a :class:`.Column` instead of just on the
:class:`.Table`.
2014-03-12 15:09:48 -04:00
Mike Bayer d85d6f9a3f - Fixed bug in new :paramref:.MetaData.naming_convention feature
where the name of a check constraint making use of the
`"%(constraint_name)s"` token would get doubled up for the
constraint generated by a boolean or enum type, and overall
duplicate events would cause the `"%(constraint_name)s"` token
to keep compounding itself.
fixes #2991
2014-03-12 14:46:55 -04:00
Mike Bayer 66338e33bf unitttest has a SkipTest also but pytest doesn't
honor it unless nose is imported too...
2014-03-11 18:06:20 -04:00
Mike Bayer 50f0d9be33 add a string example for self-refenretial many-to-many 2014-03-11 17:10:16 -04:00
Mike Bayer b7169f66d7 - A warning is emitted if the :meth:.MapperEvents.before_configured
or :meth:`.MapperEvents.after_configured` events are applied to a
specific mapper or mapped class, as the events are only invoked
for the :class:`.Mapper` target at the general level.
2014-03-11 12:39:00 -04:00
Mike Bayer 009df6a3d0 - Added a new keyword argument `once=True to :func:.event.listen`
and :func:`.event.listens_for`.  This is a convenience feature which
will wrap the given listener such that it is only invoked once.
2014-03-11 12:27:10 -04:00
mike bayer 043dc4a2c1 Merge pull request #79 from nibrahim/master
Fixes argument number in docs
2014-03-11 11:30:33 -04:00