summaryrefslogtreecommitdiff
path: root/test/engine/test_execute.py
Commit message (Collapse)AuthorAgeFilesLines
* - properly handle negative indexes in RowProxy.__getitem__()pr/231Lele Gaifax2016-01-281-0/+19
|
* - Multi-tenancy schema translation for :class:`.Table` objects is added.Mike Bayer2016-01-081-0/+186
| | | | | | | | | This supports the use case of an application that uses the same set of :class:`.Table` objects in many schemas, such as schema-per-user. A new execution option :paramref:`.Connection.execution_options.schema_translate_map` is added. fixes #2685 - latest tox doesn't like the {posargs} in the profile rerunner
* - remove the redundant non-max-row-buffer test from the max_row_bufferMike Bayer2015-06-141-12/+0
| | | | test as we implemented that as a separate test.
* - add test cases for pullreq github:182, where we add a newMike Bayer2015-06-141-47/+110
| | | | | | | | "max_row_buffer" execution option for BufferedRowResultProxy - also add documentation, changelog and version notes - rework the max_row_buffer argument to be interpreted from the execution options upfront when the BufferedRowResultProxy is first initialized.
* - Added new engine event :meth:`.ConnectionEvents.engine_disposed`.Mike Bayer2015-06-061-0/+26
| | | | Called after the :meth:`.Engine.dispose` method is called.
* - work the wrapping of the "creator" to be as resilient toMike Bayer2015-04-301-1/+1
| | | | | old / new style, direct access, and ad-hoc patching and unpatching as possible
* - New features added to support engine/pool plugins with advancedMike Bayer2015-04-301-2/+127
| | | | | | | | | | | | | | | | | | | | | | | | | functionality. Added a new "soft invalidate" feature to the connection pool at the level of the checked out connection wrapper as well as the :class:`._ConnectionRecord`. This works similarly to a modern pool invalidation in that connections aren't actively closed, but are recycled only on next checkout; this is essentially a per-connection version of that feature. A new event :class:`.PoolEvents.soft_invalidate` is added to complement it. fixes #3379 - Added new flag :attr:`.ExceptionContext.invalidate_pool_on_disconnect`. Allows an error handler within :meth:`.ConnectionEvents.handle_error` to maintain a "disconnect" condition, but to handle calling invalidate on individual connections in a specific manner within the event. - Added new event :class:`.DialectEvents.do_connect`, which allows interception / replacement of when the :meth:`.Dialect.connect` hook is called to create a DBAPI connection. Also added dialect plugin hooks :meth:`.Dialect.get_dialect_cls` and :meth:`.Dialect.engine_created` which allow external plugins to add events to existing dialects using entry points. fixes #3355
* - The "auto close" for :class:`.ResultProxy` is now a "soft" close.Mike Bayer2015-03-171-0/+41
| | | | | | | | | | | That is, after exhausing all rows using the fetch methods, the DBAPI cursor is released as before and the object may be safely discarded, but the fetch methods may continue to be called for which they will return an end-of-result object (None for fetchone, empty list for fetchmany and fetchall). Only if :meth:`.ResultProxy.close` is called explicitly will these methods raise the "result is closed" error. fixes #3330 fixes #3329
* - additional test adjustments for pypy / psycopg2cffi. ThisMike Bayer2015-01-261-24/+26
| | | | | | | | | | consists mainly of adjusting fixtures to ensure connections are closed explicitly. psycopg2cffi also handles unicode bind parameter names differently than psycopg2, and seems to possibly have a little less control over floating point values at least in one test which is marked as a "fail", though will see if it runs differently on linux than osx.. - changelog for psycopg2cffi, fixes #3052
* Added psycopg2cffi dialectShaun Stanworth2015-01-261-1/+1
|
* - Added new user-space accessors for viewing transaction isolationMike Bayer2015-01-201-0/+21
| | | | | | | | | levels; :meth:`.Connection.get_isolation_level`, :attr:`.Connection.default_isolation_level`. - enhance documentation inter-linkage between new accessors, existing isolation_level parameters, as well as in the dialect-level methods which should be fully covered by Engine/Connection level APIs now.
* - rework the handle error on connect tests from test_parsconnect whereMike Bayer2014-12-101-0/+245
| | | | they don't really belong into a new suite in test_execute
* - control the module name of the exception here for py3k compatMike Bayer2014-10-191-7/+14
|
* - Exception messages have been spiffed up a bit. The SQL statementMike Bayer2014-10-171-3/+3
| | | | | | | | | | | and parameters are not displayed if None, reducing confusion for error messages that weren't related to a statement. The full module and classname for the DBAPI-level exception is displayed, making it clear that this is a wrapped DBAPI exception. The statement and parameters themselves are bounded within a bracketed sections to better isolate them from the error message and from each other. fixes #3172
* - adjustment for ref #3200 as we need an immutabledict() here soMike Bayer2014-10-071-0/+12
| | | | | that union() can be called, in the case of a dialect that uses execution options inside of initialize() (e.g. oursql)
* - The execution options passed to an :class:`.Engine` either viaMike Bayer2014-10-061-0/+8
| | | | | | | | | | | | | | :paramref:`.create_engine.execution_options` or :meth:`.Engine.update_execution_options` are not passed to the special :class:`.Connection` used to initialize the dialect within the "first connect" event; dialects will usually perform their own queries in this phase, and none of the current available options should be applied here. In particular, the "autocommit" option was causing an attempt to autocommit within this initial connect which would fail with an AttributeError due to the non-standard state of the :class:`.Connection`. fixes #3200
* - Fixed bug where a "branched" connection, that is the kind you getMike Bayer2014-09-261-0/+11
| | | | | | | | when you call :meth:`.Connection.connect`, would not share transaction status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all transactional status and operations. fixes #3190
* - Fixed bug that affected generally the same classes of eventMike Bayer2014-09-181-0/+42
| | | | | | | | | | as that of :ticket:`3199`, when the ``named=True`` parameter would be used. Some events would fail to register, and others would not invoke the event arguments correctly, generally in the case of when an event was "wrapped" for adaption in some other way. The "named" mechanics have been rearranged to not interfere with the argument signature expected by internal wrapper functions. fixes #3197
* - pep8 cleanupMike Bayer2014-08-201-1/+0
|
* - The string keys that are used to determine the columns impactedMike Bayer2014-08-141-3/+45
| | | | | | | | | for an INSERT or UPDATE are now sorted when they contribute towards the "compiled cache" cache key. These keys were previously not deterministically ordered, meaning the same statement could be cached multiple times on equivalent keys, costing both in terms of memory as well as performance. fixes #3165
* - workaround removal of nested() in py3kMike Bayer2014-07-301-1/+2
|
* pep8 cleanupMike Bayer2014-07-291-285/+342
|
* - The exception wrapping system for DBAPI errors can now accommodateMike Bayer2014-07-291-1/+26
| | | | | | | | non-standard DBAPI exceptions, such as the psycopg2 TransactionRollbackError. These exceptions will now be raised using the closest available subclass in ``sqlalchemy.exc``, in the case of TransactionRollbackError, ``sqlalchemy.exc.OperationalError``. fixes #3075
* fix paren hereMike Bayer2014-07-261-2/+3
|
* - The MySQL dialect will now disable :meth:`.ConnectionEvents.handle_error`Mike Bayer2014-07-251-0/+28
| | | | | | | | | | events from firing for those statements which it uses internally to detect if a table exists or not. This is achieved using an execution option ``skip_user_error_events`` that disables the handle error event for the scope of that execution. In this way, user code that rewrites exceptions doesn't need to worry about the MySQL dialect or other dialects that occasionally need to catch SQLAlchemy specific exceptions.
* - add test support for disconnect modificationMike Bayer2014-07-041-0/+25
|
* - rework the entire approach to #3076. As we need to catch all exceptionsMike Bayer2014-07-041-125/+267
| | | | | | | | | | | in all cases unconditionally, the number of use cases that go beyond what dbapi_error() is expecting has gone too far for an 0.9 release. Additionally, the number of things we'd like to track is really a lot more than the five arguments here, and ExecutionContext is really not suitable as totally public API for this. So restore dbapi_error to its old version, deprecate, and build out handle_error instead. This is a lot more extensible and doesn't get in the way of anything compatibility-wise.
* - The mechanics of the :meth:`.ConnectionEvents.dbapi_error` handlerMike Bayer2014-07-031-0/+111
| | | | | | | have been enhanced such that the function handler is now capable of raising or returning a new exception object, which will replace the exception normally being thrown by SQLAlchemy. fixes #3076
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-1/+1
| | | | Found using: https://github.com/intgr/topy
* pickle of execption not supported on mysqlconnectorMike Bayer2014-03-281-0/+2
|
* add some more mock structure so tricky DBAPIs like pypy workMike Bayer2014-03-241-0/+8
|
* - add some more rules to make sure all tests run if DBs are availableMike Bayer2014-03-241-0/+1
|
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-241-234/+8
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* - Added some new event mechanics for dialect-level events; the initialMike Bayer2014-03-241-1/+110
| | | | | | | 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.
* - An event listener can now be associated with a :class:`.Engine`,Mike Bayer2014-03-221-0/+33
| | | | | | | | | | 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
* there's no "assert_call_count" on mockMike Bayer2014-03-221-9/+10
|
* - restore the old behavior of the connection pool replacing itself justMike Bayer2014-03-221-0/+12
| | | | | | | | 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.
* - The :meth:`.ConnectionEvents.after_cursor_execute` event is nowMike Bayer2014-03-191-0/+42
| | | | | | | | | | | | 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.
* - The MySQL CAST compilation now takes into account aspects of a stringMike Bayer2014-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | | type such as "charset" and "collation". While MySQL wants all character- based CAST calls to use the CHAR type, we now create a real CHAR object at CAST time and copy over all the parameters it has, so that an expression like ``cast(x, mysql.TEXT(charset='utf8'))`` will render ``CAST(t.col AS CHAR CHARACTER SET utf8)``. - Added new "unicode returns" detection to the MySQL dialect and to the default dialect system overall, such that any dialect can add extra "tests" to the on-first-connect "does this DBAPI return unicode directly?" detection. In this case, we are adding a check specifically against the "utf8" encoding with an explicit "utf8_bin" collation type (after checking that this collation is available) to test for some buggy unicode behavior observed with MySQLdb version 1.2.3. While MySQLdb has resolved this issue as of 1.2.4, the check here should guard against regressions. The change also allows the "unicode" checks to log in the engine logs, which was not previously the case. [ticket:2906]
* revert r2775c95b1ee30831216cc5 which was mostly an inadvertent commit, ↵Mike Bayer2014-01-131-1/+1
| | | | except for the changelog part
* new changelogMike Bayer2014-01-111-1/+1
|
* - these tests are really old but trying to make sure everything is closed outMike Bayer2014-01-051-40/+40
|
* - A DBAPI that raises an error on ``connect()`` which is not a subclassMike Bayer2013-12-071-8/+26
| | | | | | | | | | | | of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.) will propagate the exception unchanged. Previously, the error handling specific to the ``connect()`` routine would both inappropriately run the exception through the dialect's :meth:`.Dialect.is_disconnect` routine as well as wrap it in a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged in the same way as occurs within the execute process. [ticket:2881] - add tests for this in test_parseconnect, but also add tests in test_execute to ensure the execute() behavior as well
* -be more agnostic of quotes hereMike Bayer2013-11-231-2/+2
|
* - Fixed bug where SQL statement would be improperly ASCII-encodedMike Bayer2013-11-221-2/+20
| | | | | | | when a pre-DBAPI :class:`.StatementError` were raised within :meth:`.Connection.execute`, causing encoding errors for non-ASCII statements. The stringification now remains within Python unicode thus avoiding encoding errors. [ticket:2871]
* - remove informix dialect, moved out to ↵Mike Bayer2013-11-171-4/+3
| | | | | | https://bitbucket.org/zzzeek/sqlalchemy_informixdb - remove informix, maxdb, access symbols from tests etc.
* - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynorMike Bayer2013-09-221-1/+0
|
* - ensure rowcount is returned for an UPDATE with no implicit returningMike Bayer2013-08-251-27/+27
| | | | | - modernize test for that - use py3k compatible next() in test_returning/test_versioning
* - refactor pool a bit so that intent between ↵Mike Bayer2013-07-021-30/+110
| | | | | | | | | | | | | | 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()
* - replace most explicitly-named test objects called "Mock..." withMike Bayer2013-06-301-10/+14
| | | | | | | | | | | | 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.