Commit Graph

77 Commits

Author SHA1 Message Date
Mike Bayer 9273cdd638 - [bug] If conn.begin() fails when calling
"with engine.begin()", the newly acquired
Connection is closed explicitly before
propagating the exception onward normally.
2012-04-12 14:38:52 -04:00
Mike Bayer 5280f26d45 - [feature] Added new connection event
dbapi_error(). Is called for all DBAPI-level
errors passing the original DBAPI exception
before SQLAlchemy modifies the state
of the cursor.
2012-04-10 19:38:22 -04:00
Mike Bayer 7feaad21e6 test failures 2012-02-15 10:13:47 -05:00
Mike Bayer df15546cb8 - [feature] Added "no_parameters=True" execution
option for connections.   If no parameters
    are present, will pass the statement
    as cursor.execute(statement), thereby invoking
    the DBAPIs behavior when no parameter collection
    is present; for psycopg2 and mysql-python, this
    means not interpreting % signs in the string.
    This only occurs with this option, and not
    just if the param list is blank, as otherwise
    this would produce inconsistent behavior
    of SQL expressions that normally escape percent
    signs (and while compiling, can't know ahead of
    time if parameters will be present in
    some cases).  [ticket:2407]
2012-02-13 20:07:44 -05:00
Mike Bayer 04c7bae308 - test failures. one in particular seems to be a weird oursql bug, oh well 2012-02-12 20:00:44 -05:00
Mike Bayer c710f6cbf6 - add a context manager availble via Engine.begin()
- add a test suite for all the Engine/Connection/TLEngine transaction/begin
helpers/context managers
- update docs
2012-02-12 16:43:26 -05:00
Mike Bayer b7f7ed2105 fix a few py3k bugs 2012-01-28 15:32:53 -05:00
Mike Bayer 780cd9dce4 - [bug] Fixed bug in "mock" strategy whereby
correct DDL visit method wasn't called, resulting
in "CREATE/DROP SEQUENCE" statements being
duplicated [ticket:2384]
2012-01-28 14:29:26 -05:00
Mike Bayer 3e6d1b0845 exception pickling fails on cx_oracle 2012-01-22 22:37:23 -05:00
Mike Bayer 09a503e497 - [bug] Fixed bug whereby a table-bound Column
object named "<a>_<b>" which matched a column
labeled as "<tablename>_<colname>" could match
inappropriately when targeting in a result
set row.  [ticket:2377]
- requires that we change the tuple format in RowProxy.
Makes an improvement to the cases tested against
an unpickled RowProxy as well though doesn't solve the
problem there entirely.
2012-01-22 14:04:20 -05:00
Mike Bayer 7026ffe57c another serializable for [ticket:2371] 2012-01-12 00:49:02 -05:00
Mike Bayer 26625d897f further fixes for column/table errors 2012-01-11 20:47:53 -05:00
Mike Bayer 70383385d2 some adjustments for py3k 2012-01-11 20:45:28 -05:00
Mike Bayer b4fcdc19a8 fix failures for oursql, python 2.4 2012-01-11 20:35:57 -05:00
Mike Bayer d78d2d60aa - [bug] Added __reduce__ to StatementError,
DBAPIError so that exceptions are pickleable,
as when using multiprocessing.  However, not
all DBAPIs support this yet, such as
psycopg2. [ticket:2371]
2012-01-10 11:15:11 -05:00
Mike Bayer 0c6f6e2b77 fix this test for oursql 2011-10-15 15:22:21 -04:00
Mike Bayer f1eea63468 - Added an exception catch + warning for the
"return unicode detection" step within connect,
allows databases that crash on NVARCHAR to
continue initializing, assuming no NVARCHAR
type implemented.  [ticket:2299]
2011-10-15 12:10:31 -04:00
Mike Bayer d3c1f245ef - Improvement to multi-param statement logging,
long lists of bound parameter sets will be
compressed with an informative indicator
of the compression taking place.  Exception
messages use the same improved formatting.
[ticket:2243]
2011-08-22 11:12:36 -04:00
Mike Bayer 1006f17051 if python 2.4, have DontWrapException be old style 2011-06-26 19:50:31 -04:00
Mike Bayer e821573a24 - Added mixin class sqlalchemy.ext.DontWrapMixin.
User-defined exceptions of this type are never
wrapped in StatementException when they
occur in the context of a statement
execution.

- StatementException wrapping will display the
original exception class in the message.
2011-06-22 11:45:28 -04:00
Mike Bayer 4d99799ee7 - given that Oracle's issue is not just open connections, but *closed* ones too, go really
heavy handed and start marking tests as "requires.ad_hoc_engines", add a flag --low-connections
that will switch the engine reaper mechanism to use as *few* distinct engines and connections
as possible, many engine tests that really need their own engines are just skipped.
2011-05-09 20:40:33 -04:00
Mike Bayer e1ec36fc9e - hardcore force every connection into a strong-referenced set, rollback on every test, close on every context.
this uses pool events but bypasses the pool's fairy/record/dispose services.   pypy still seems to expose
some holes in that at least as far as what some (or maybe just one, cant find it yet) of the tests does.
haven't tested this too deeply, just on sqlite + postgres, cypthon 2.7 + pypy.   will see what the buildbot
says
2011-04-25 21:50:26 -04:00
Mike Bayer 7ab1eb81d6 - this passes --mockpool for test_execute 100% with pypy. still makes test_reflection later on hang. 2011-04-22 23:52:01 -04:00
Mike Bayer c29ece8b09 - ensure test_execute passes with --mockpool 2011-04-22 23:28:45 -04:00
Mike Bayer 7b2a76c4a3 grumpy fix 2011-04-22 22:17:43 -04:00
Mike Bayer 7b24e458c7 - move all the comments that got shoved below the fixture grabs back up 2011-03-27 17:19:00 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer ebd0fdad73 - convert @provide_metadata to use self access
- having occasional issues with BasicEntity grabbing, if it persists
may have to pass an explicit base class into setup_classes()/setup_mappers()
2011-03-26 21:40:05 -04:00
Mike Bayer 7dab4ae6a9 - rename EngineEvents to ConnectionEvents
- simplify connection event model to be inline inside Connection, don't use ad-hoc
subclasses (technically would leak memory for the app that keeps creating engines
and adding events)
- not doing listen-per-connection yet.  this is closer.  overall things
are much simpler now (until we put listen-per-connection in...)
2011-02-17 19:59:45 -05:00
Mike Bayer 7e8f351097 - Non-DBAPI errors which occur in the scope of an execute()
call are now wrapped in sqlalchemy.exc.StatementError,
and the text of the SQL statement and repr() of params
is included.  This makes it easier to identify statement
executions which fail before the DBAPI becomes
involved.  [ticket:2015]
2011-02-09 18:11:40 -05:00
Mike Bayer 5baeabb0c4 - use proper directive here 2011-02-05 16:10:14 -05:00
Mike Bayer 637fdd3251 - apply optimizations to alternate row proxies, [ticket:1787]
- add check to fetchmany() for None, don't send argument if not present,
helps DBAPIs which don't accept "None" for default (ie. pysqlite, maybe others)
- add tests to test_execute to provide 100% coverage for the three alternate
result proxy classes
2011-02-04 18:33:49 -05:00
Mike Bayer 1515073b96 - New DBAPI support for pymysql, a pure Python port
of MySQL-python.  [ticket:1991]
2011-01-26 11:18:03 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer 426c4356eb - removes the "on_" prefix. 2010-12-30 14:22:43 -05:00
Mike Bayer 987828194e oracle fixes 2010-12-06 17:05:32 -05:00
Mike Bayer d30678d18d new calling style: event.listen(target, identifier, fn) 2010-12-01 14:10:11 -05:00
Mike Bayer 58b2939433 - sqlalchemy.test and nose plugin moves back to being entirely
outside of "sqlalchemy" and under "test/".

Rationale:

- coverage plugin works without issue, without need for an awkward
additional package install
- command line for "nosetests" isn't polluted with SQLAlchemy options

[ticket:1949]
2010-11-28 14:19:44 -05:00
Mike Bayer 45cdb17ef0 - fixes for PG, mysql, twophase
- added "pool_events" arg to create_engine(), "events" to pool, allowing
establishment of listeners which fire before those of the dialect
2010-11-20 17:57:30 -05:00
Mike Bayer ca2d85540f - logging has been overhauled such that engines no longer need to encode the
"hex id" string in their logging name in order to maintain separate loggers
per engine. thanks to Vinay Sajip for assistance.  merge of [ticket:1926]
2010-11-20 16:28:39 -05:00
Mike Bayer 98674959d2 - initial patch for [ticket:1926] 2010-11-17 17:54:52 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 6d630990dd merge tip 2010-11-13 15:53:32 -05:00
Mike Bayer 3564ea86e7 - move deprecated interfaces down to bottom of TOC, update verbiage
- more docs for engine, pool, DDL events
- update DDL sequences documentation to use events
- update DDL() docstring to refer to execute_if()
- document parameters for DDLElement.execute_if()
- add retval=True flag to Engine.on_before_execute(), on_before_cursor_execute().
wrap the function if retval=False, check for appropriate usage of the flag, add
tests.
- remove ScopedSession.mapper and tests entirely
- remove ExtensionCarrier and tests
- change remaining tests that use MapperExtension to use MapperEvents
2010-11-10 19:00:28 -05:00
Mike Bayer e1a30715d2 - and fix everything from the last checkin that breaks on py 2.4, 2.5 2010-11-09 11:46:52 -05:00
Mike Bayer a41c50ad63 - Implemented sequence check capability for the C
version of RowProxy, as well as 2.7 style
"collections.Sequence" registration for RowProxy.
[ticket:1871]
2010-11-09 11:40:23 -05:00
Mike Bayer 25c08f6def merge tip 2010-10-02 11:00:22 -04:00
Mike Bayer 761b4f29e2 - *Major* cleanup / modernization of the Informix
dialect for 0.6, courtesy Florian Apolloner.
[ticket:1906]
2010-10-01 21:26:05 -04:00
Mike Bayer 1149197a36 - moved out to on_before_execute, on_after_execute. not much option here,
need both forms, the wrapping thing is just silly
- fixed the listen() to not re-wrap continuously.
2010-08-29 11:22:46 -04:00
Mike Bayer a635750213 going back to the simple way, plus trying to make the engine thing simpler, and....doesn't work.
on_before_execute and on_after_execute really not appealing here.   might have to just go back to
what it was the other day.
2010-08-28 11:29:07 -04:00