Commit Graph

10240 Commits

Author SHA1 Message Date
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
Noufal Ibrahim 8b0bf57840 Fixes argument number in docs
The selectable is the third argument to with_polymorphic.
2014-03-11 17:22:01 +05:30
Mike Bayer dbd1015d81 take out the support paragraph and just put a basic intro 2014-03-09 19:13:35 -04:00
mike bayer d35d840c41 Merge pull request #75 from msabramo/pymssql_update_web_site
Update URL for pymssql
2014-03-09 19:08:45 -04:00
Mike Bayer c9843bb395 put fails for these various things that don't work on pypy, not sure what approach
should be taken
2014-03-08 13:52:27 -05:00
Mike Bayer 63bb4ec5ab import testing needs to be here as we set .db on it 2014-03-07 17:26:57 -05:00
Mike Bayer a4e84a154c - cx_oracle test for "unicode returns" needs to be cx_oracle only,
and also will fail on py3k.
- enhance exclusions so that a requirement attribute can be passed
to fails_if/skip_if.
- fix coverage docs to mention pytest.
2014-03-06 11:57:54 -05:00
Mike Bayer 4175ca2050 - changelog for pullreq github:74
- various improvemnts to oracle docs, rewrite section on unicode, more linking,
enhance section on resolve_synonyms
2014-03-05 18:58:37 -05:00
Mike Bayer 321a668ccd Merge branch 'master' of https://github.com/Cito/sqlalchemy into t 2014-03-05 18:16:11 -05:00
Mike Bayer 48b82aebc3 - Fixed small issue in :class:.SingletonThreadPool where the current
connection to be returned might get inadvertently cleaned out during
the "cleanup" process.  Patch courtesy jd23.
2014-03-05 18:14:09 -05:00
Mike Bayer 5299352ccf ignore .patch files 2014-03-05 18:07:24 -05:00
Mike Bayer a5f8a04f6b - finding myself still using nose for short runs as it starts up faster,
let's stay on the fence.
2014-03-05 09:51:55 -05:00
Mike Bayer ab2b3b0862 pytest calls all the descriptors. and we can't call this one unconditionally 2014-03-04 18:17:53 -05:00
Mike Bayer 81783a6241 - no unitest.SkipTest in 2.6...arggggg 2014-03-04 12:58:14 -05:00
Mike Bayer c6f540da58 cut out the BS as far as MySQLdb urls, put the one url everyone should be using 2014-03-04 12:51:23 -05:00
Mike Bayer d6e8d5eddb - Fixed bug in association proxy where assigning an empty slice
(e.g. ``x[:] = [...]``) would fail on Py3k.
2014-03-04 10:59:27 -05:00
Mike Bayer f3becf64df add a seealso here 2014-03-04 00:44:57 -05:00
Mike Bayer 2469b651e6 fix the profiling ids here 2014-03-03 18:43:28 -05:00