summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/strategies.py
Commit message (Collapse)AuthorAgeFilesLines
* - The engine-level error handling and wrapping routines will nowMike Bayer2014-12-051-10/+1
| | | | | | | | | take effect in all engine connection use cases, including when user-custom connect routines are used via the :paramref:`.create_engine.creator` parameter, as well as when the :class:`.Connection` encounters a connection error on revalidation. fixes #3266
* - adjustment for ref #3200 as we need an immutabledict() here soMike Bayer2014-10-071-1/+1
| | | | | 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/+1
| | | | | | | | | | | | | | :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
* PEP8 style fixesBrian Jarrett2014-07-131-6/+6
|
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - vastly improve the "safe close cursor" tests in test_reconnectMike Bayer2014-05-301-1/+0
| | | | | | | | | | | - Fixed bug which would occur if a DBAPI exception occurs when the engine first connects and does its initial checks, and the exception is not a disconnect exception, yet the cursor raises an error when we try to close it. In this case the real exception would be quashed as we tried to log the cursor close exception via the connection pool and failed, as we were trying to access the pool's logger in a way that is inappropriate in this very specific scenario. fixes #3063
* - Added a new keyword argument ``once=True`` to :func:`.event.listen`Mike Bayer2014-03-111-2/+1
| | | | | and :func:`.event.listens_for`. This is a convenience feature which will wrap the given listener such that it is only invoked once.
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - The :func:`.engine_from_config` function has been improved so thatMike Bayer2013-12-071-8/+17
| | | | | | | | we will be able to parse dialect-specific arguments from string configuration dictionaries. Dialect classes can now provide their own list of parameter types and string-conversion routines. The feature is not yet used by the built-in dialects, however. [ticket:2875]
* - A DBAPI that raises an error on ``connect()`` which is not a subclassMike Bayer2013-12-071-1/+1
| | | | | | | | | | | | 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
* Dialect.initialize() is not called a second time if an :class:`.Engine`Mike Bayer2013-07-111-0/+1
| | | | | | is recreated, due to a disconnect error. This fixes a particular issue in the Oracle 8 dialect, but in general the dialect.initialize() phase should only be once per dialect. Also in 0.8.3. [ticket:2776]
* - refactor pool a bit so that intent between ↵Mike Bayer2013-07-021-7/+2
| | | | | | | | | | | | | | 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()
* import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-271-13/+6
|
* - the raw 2to3 runMike Bayer2013-04-271-12/+13
| | | | - went through examples/ and cleaned out excess list() calls
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/engine/Diana Clarke2012-11-191-14/+16
|
* -whitespace bonanza, contdMike Bayer2012-07-281-3/+3
|
* typos in lib/sqlalchemy/engineDiana Clarke2012-03-171-3/+3
|
* - [bug] Added execution_options() call toMike Bayer2012-02-131-0/+3
| | | | | | MockConnection (i.e., that used with strategy="mock") which acts as a pass through for arguments.
* - [feature] Added pool_reset_on_return argumentMike Bayer2012-02-011-1/+2
| | | | | | | | to create_engine, allows control over "connection return" behavior. Also added new arguments 'rollback', 'commit', None to pool.reset_on_return to allow more control over connection return activity. [ticket:2378]
* - [bug] Fixed bug in "mock" strategy wherebyMike Bayer2012-01-281-3/+3
| | | | | | correct DDL visit method wasn't called, resulting in "CREATE/DROP SEQUENCE" statements being duplicated [ticket:2384]
* happy new yearMike Bayer2012-01-041-1/+1
|
* - fix up the invalidate on connect for py3kMike Bayer2011-07-061-2/+6
| | | | - fix the test for separately installed pysqlite
* - Failures on connect which raise dbapi.ErrorMike Bayer2011-07-011-1/+2
| | | | | | | | | | | | will forward the error to dialect.is_disconnect() and set the "connection_invalidated" flag if the dialect knows this to be a potentially "retryable" condition. Only Oracle ORA-01033 implemented for now. [ticket:2201] - Added ORA-01033 to disconnect codes, which can be caught during a connection event. [ticket:2201]
* - Deprecate schema/SQL-oriented methods onMike Bayer2011-06-021-0/+7
| | | | | | | Connection/Engine that were never well known and are redundant: reflecttable(), create(), drop(), text(), engine.func - lots of docstrings in engine
* - rename EngineEvents to ConnectionEventsMike Bayer2011-02-171-0/+7
| | | | | | | | - 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...)
* - py3k fix regarding new exception systemMike Bayer2011-02-091-1/+1
| | | | | - this test keeps throwing a TNS error on Oracle on the buildbot only, runs locally, seems to be related to some scaling/memory type of issue on the bot
* - Non-DBAPI errors which occur in the scope of an `execute()`Mike Bayer2011-02-091-2/+5
| | | | | | | | 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]
* - whitespace removal bonanzaMike Bayer2011-01-021-11/+11
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* - removes the "on_" prefix.Mike Bayer2010-12-301-3/+3
|
* new calling style: event.listen(target, identifier, fn)Mike Bayer2010-12-011-3/+3
|
* - NullPool is now used by default for SQLite file-Mike Bayer2010-11-281-6/+3
| | | | | | based databases. :memory: databases will continue to select SingletonThreadPool by default. [ticket:1921]
* - fixes for PG, mysql, twophaseMike Bayer2010-11-201-0/+1
| | | | | - added "pool_events" arg to create_engine(), "events" to pool, allowing establishment of listeners which fire before those of the dialect
* going back to the simple way, plus trying to make the engine thing simpler, ↵Mike Bayer2010-08-281-3/+3
| | | | | | | 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.
* - its probably worthwhile to make the primary listen() interface humane, i.e.:Mike Bayer2010-08-271-3/+3
| | | | | | | | | | | | | | | | def listen(target, args) so here we provide a "wrapper" approach that allows this, and it is basically pass-by-value. a pass-by-value event *may* support rewriting some of the args in the dictionary. the current listen will become "listen_raw" since it saves about 100% overhead versus the coercion to dict, and will be used internally, and will remain pass-by-reference. proxyconnection probably will rely upon the newer style of pass-by-value for "rewrite the args" types of calls.
* - worked it out so that classes declare a nested class "event",Mike Bayer2010-07-241-8/+9
| | | | | | | | | with methods representing events. This is self-documenting via sphinx. - implemented new model for pool, classmanager. Most events are one or two args, so going back to allowing any kind of *arg, **kw signature for events - this is simpler and improves performance, though we don't get the "we can add new kw's anytime". perhaps there's some other way to approach that.
* - The visit_pool() method of Dialect is removed, and replaced withMike Bayer2010-03-151-2/+10
| | | | | | | | on_connect(). This method returns a callable which receives the raw DBAPI connection after each one is created. The callable is assembled into a first_connect/connect pool listener by the connection strategy if non-None. Provides a simpler interface for dialects.
* - Added "logging_name" argument to create_engine(), Pool() constructorMike Bayer2010-03-131-1/+2
| | | | | | | as well as "pool_logging_name" argument to create_engine() which filters down to that of Pool. Issues the given string name within the "name" field of logging messages instead of the default hex identifier string. [ticket:1555]
* - The psycopg2 dialect now uses psycopg2's "unicode extension"Mike Bayer2009-10-261-9/+6
| | | | | | | | | | | | | | | | | | on all new connections, which allows all String/Text/etc. types to skip the need to post-process bytestrings into unicode (an expensive step due to its volume). Other dialects which return unicode natively (pg8000, zxjdbc) also skip unicode post-processing. - String/Text/Unicode types now skip the unicode() check on each result column value if the dialect has detected the DBAPI as returning Python unicode objects natively. This check is issued on first connect using "SELECT CAST 'some text' AS VARCHAR(10)" or equivalent, then checking if the returned object is a Python unicode. This allows vast performance increases for native-unicode DBAPIs, including pysqlite/sqlite3, psycopg2, and pg8000.
* merge 0.6 series to trunk.Mike Bayer2009-08-061-41/+49
|
* - merged -r5338:5429 of sphinx branch.Mike Bayer2008-12-061-1/+1
| | | | | | | | | | | | | - Documentation has been converted to Sphinx. In particular, the generated API documentation has been constructed into a full blown "API Reference" section which organizes editorial documentation combined with generated docstrings. Cross linking between sections and API docs are vastly improved, a javascript-powered search feature is provided, and a full index of all classes, functions and members is provided.
* - Mock engines take on the .name of their dialect. [ticket:1123]Jason Kirtland2008-08-151-10/+11
| | | | | Slightly backward incompatible: the .name is a read-only property. The test suite was assigning .name = 'mock'; this no longer works.
* And thus ends support for Python 2.3.Jason Kirtland2008-07-151-1/+1
|
* pool_threadlocal is off by default [ticket:1049]Mike Bayer2008-05-191-1/+1
|
* r4695 merged to trunk; trunk now becomes 0.5.Mike Bayer2008-05-091-3/+3
| | | | 0.4 development continues at /sqlalchemy/branches/rel_0_4
* introductory docstring bonanzaMike Bayer2007-12-181-5/+8
|
* - added partial index support for postgresAnts Aasma2007-09-291-2/+2
| | | | - fixed create and drop methods on MockConnection
* - merged inline inserts branchMike Bayer2007-09-011-1/+1
| | | | | | | | | | | | - all executemany() style calls put all sequences and SQL defaults inline into a single SQL statement and don't do any pre-execution - regular Insert and Update objects can have inline=True, forcing all executions to be inlined. - no last_inserted_ids(), lastrow_has_defaults() available with inline execution - calculation of pre/post execute pushed into compiler; DefaultExecutionContext greatly simplified - fixed postgres reflection of primary key columns with no sequence/default generator, sets autoincrement=False - fixed postgres executemany() behavior regarding sequences present, not present, passivedefaults, etc. - all tests pass for sqlite, mysql, postgres; oracle tests pass as well as they did previously including all insert/update/default functionality
* pool_threadlocal on by defaultMike Bayer2007-08-201-1/+1
|