summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/default.py
Commit message (Collapse)AuthorAgeFilesLines
* typos in lib/sqlalchemy/engineDiana Clarke2012-03-171-2/+2
|
* - [feature] Added "no_parameters=True" executionMike Bayer2012-02-131-0/+7
| | | | | | | | | | | | | | | | 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]
* - [bug] A significant change to how labelingMike Bayer2012-02-051-0/+5
| | | | | | | | | | | | | | is applied to columns in SELECT statements allows "truncated" labels, that is label names that are generated in Python which exceed the maximum identifier length (note this is configurable via label_length on create_engine()), to be properly referenced when rendered inside of a subquery, as well as to be present in a result set row using their original in-Python names. [ticket:2396] - apply pep8 to test_labels
* - [feature] New reflection feature "autoload_replace";Mike Bayer2012-01-281-2/+2
| | | | | | | | | | | | | | | when set to False on Table, the Table can be autoloaded without existing columns being replaced. Allows more flexible chains of Table construction/reflection to be constructed, including that it helps with combining Declarative with table reflection. See the new example on the wiki. [ticket:2356] - [bug] Improved the API for add_column() such that if the same column is added to its own table, an error is not raised and the constraints don't get doubled up. Also helps with some reflection/declarative patterns. [ticket:2356]
* happy new yearMike Bayer2012-01-041-1/+1
|
* - Added an exception catch + warning for theMike Bayer2011-10-151-13/+18
| | | | | | | "return unicode detection" step within connect, allows databases that crash on NVARCHAR to continue initializing, assuming no NVARCHAR type implemented. [ticket:2299]
* - assume in py3k that description encoding is None unless the dialect reallyMike Bayer2011-04-081-7/+7
| | | | | overrides it - psycopg2 + 3k supports unicode statements...
* - Non-DBAPI errors which occur in the scope of an `execute()`Mike Bayer2011-02-091-1/+1
| | | | | | | | 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]
* - add connection and cursor to is_disconnect(). We aren't using it yet,Mike Bayer2011-02-091-1/+1
| | | | | | | | | | | | | | | but we'd like to. Most DBAPIs don't give us anything we can do with it. Some research was done on psycopg2 and it still seems like they give us no adequate method (tried connection.closed, cursor.closed, connection.status). mxodbc claims their .closed attribute will work (but I am skeptical). - remove beahvior in pool that auto-invalidated a connection when the cursor failed to create. That's not the pool's job. we need the conn for the error logic. Can't get any tests to fail, curious why that behavior was there, guess we'll find out (or not). - add support for psycopg2 version detection. even though we have no use for it yet... - adjust one of the reconnect tests to work with oracle's horrendously slow connect speed
* - new dialect for Drizzle [ticket:2003]Mike Bayer2011-01-261-0/+1
| | | | - move mysqldb to a connector, can be shared among mysql/drizzle
* - default_isolation_level is equal to isolation_level since it'sMike Bayer2011-01-161-4/+4
| | | | detected after the initial setting
* - add dialect.reset_isolation_level(), revertsMike Bayer2011-01-161-0/+11
| | | | - base not implemented methods on Dialect
* - getting slightly more consistent behavior for the edge case of pk columnsMike Bayer2011-01-151-2/+3
| | | | | | with server default - autoincrement is now false with any server_default, so these all return None, applies consistency to [ticket:2020], [ticket:2021]. if prefetch is desired a "default" should be used instead of server_default.
* - the _pk_processors/_prefetch_processors approach relied upon calling RPs ↵Mike Bayer2011-01-151-26/+33
| | | | | | | | without a cursor.description result, also generates procs that are not used in most cases. simplify the approach by passing type to _exec_default() to be used if needed by _execute_scalar(), looking for the proc on just t._autoincrement_column in post_insert().
* - A TypeDecorator of Integer can be used with a primary keyMike Bayer2011-01-111-18/+30
| | | | | | | | | | | | | | | | | | | column, and the "autoincrement" feature of various dialects as well as the "sqlite_autoincrement" flag will honor the underlying database type as being Integer-based. [ticket:2005] - Result-row processors are applied to pre-executed SQL defaults, as well as cursor.lastrowid, when determining the contents of result.inserted_primary_key. [ticket:2006] - Bind parameters present in the "columns clause" of a select are now auto-labeled like other "anonymous" clauses, which among other things allows their "type" to be meaningful when the row is fetched, as in result row processors. - TypeDecorator is present in the "sqlalchemy" import space.
* - whitespace removal bonanzaMike Bayer2011-01-021-75/+75
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-1/+1
| | | | | a consistent tag - AUTHORS file
* py3k fixesMike Bayer2010-12-271-1/+2
|
* - another heap of inlinings and now I really have to be done with thisMike Bayer2010-12-211-9/+15
|
* more inlinesMike Bayer2010-12-191-25/+25
|
* establish default for returns_unicode_strings in py3kMike Bayer2010-12-191-0/+2
|
* - duh, compiled is per dialectMike Bayer2010-12-191-1/+1
|
* - fixes for mysql and I'm ready to replace this whole adapt() business with ↵Mike Bayer2010-12-141-2/+4
| | | | a constructor copy
* - system to cache the bind/result processors in a dialect-wide registry.Mike Bayer2010-12-131-1/+4
| | | | its an idea with pointy edges.
* - why type.dialect_impl(dialect).bind_processor(dialect), caching just the impl?Mike Bayer2010-12-131-17/+8
| | | | | | just call type._cached_bind_processor(dialect), cache the impl *and* the processor function. same for result sets. - use plain dict + update for defaultexecutioncontext.execution_options
* - another easy win, cache the calc of bind processors in the compiled objectMike Bayer2010-12-121-7/+2
|
* - clean up the batch insert thingMike Bayer2010-12-111-49/+16
| | | | | | | | | | - add a test for batch inserts - don't need elaborate _inserted_primary_key thing - take some cruft out of ExecutionContext, ResultProxy, EC members can be non-underscored, have mapper just call the EC members for now. - simplify "connection_callable", no need for a "flush_opts" dictionary since this point of expansion is not needed
* - initial stab at using executemany() for inserts in the ORM when possibleMike Bayer2010-12-101-17/+43
|
* - more inlining. nominal execution on sqlite down to 36 calls, from 51 in 0.6.Mike Bayer2010-12-051-2/+0
|
* - inline the various construction methods of DefaultExecutionContext. ThisMike Bayer2010-12-051-154/+190
| | | | | makes it sort of easier to read, sort of harder, depending on where you look. Cuts down two or three method calls on execute.
* - ResultProxy and friends always reference the DBAPI connection at the same timeMike Bayer2010-12-051-1/+1
| | | | | | | | as the cursor. There is no reason for CursorFairy - the only use case would be, end-user is using the pool or pool.manage with DBAPI connections, uses a cursor, deferences the owning connection and continues using cursor. This is an almost nonexistent use case and isn't correct usage at a DBAPI level. Take out CursorFairy. - move the "check for a dot in the colname" logic out to the sqlite dialect.
* - NullPool is now used by default for SQLite file-Mike Bayer2010-11-281-1/+5
| | | | | | based databases. :memory: databases will continue to select SingletonThreadPool by default. [ticket:1921]
* - engine_from_config() now accepts 'debug' forMike Bayer2010-10-151-1/+0
| | | | | | 'echo', 'echo_pool', 'force' for 'convert_unicode', boolean values for 'use_native_unicode'. [ticket:1899]
* - The generated index name also is based onMike Bayer2010-08-021-0/+11
| | | | | | | | a "max index name length" attribute which is separate from the "max identifier length" - this to appease MySQL who has a max length of 64 for index names, separate from their overall max length of 255. [ticket:1412]
* - updated obsolete docs regarding sequences, RETURNING for pgrel_0_6_2Mike Bayer2010-07-061-22/+34
| | | | - 78 chars for postgresql/base.py, engine/default.py
* - Fixed bug that prevented implicit RETURNING from functioningMike Bayer2010-04-221-3/+8
| | | | | properly with composite primary key that contained zeroes. [ticket:1778]
* - Added get_pk_constraint() to reflection.Inspector, similarMike Bayer2010-04-151-0/+11
| | | | | | | | to get_primary_keys() except returns a dict that includes the name of the constraint, for supported backends (PG so far). [ticket:1769] - Postgresql reflects the name of primary key constraints, if one exists. [ticket:1769]
* mssql+mxodbc should use executedirect for all selects and execute for ↵Mike Bayer2010-03-261-1/+4
| | | | insert/update/delete. To support this, an is_crud property has been added to the DefaultExecutionContext. The behavior is forcable either way per execution using execution_options(native_odbc_parameters=True|False). Some tests have been added to demonstrate usage. (patch by zzzeek committed by bradallen)
* - pyodbc can do *some* unicode with sybase, python-sybase not at all.Mike Bayer2010-03-171-1/+1
| | | | | Since python-sybase source code seems to be all from 2001 with no updates, making pyodbc the default driver.
* - added pyodbc for sybase driver.Mike Bayer2010-03-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | - generalized the "freetds" / "unicode statements" behavior of MS-SQL/pyodbc into the base Pyodbc connector, as this seems to apply to Sybase as well. - generalized the python-sybase "use autocommit for DDL" into the pyodbc connector. With pyodbc, the "autocommit" flag on connection is used, as Pyodbc seems to have more database conversation than python-sybase that can't otherwise be suppressed. - Some platforms will now interpret certain literal values as non-bind parameters, rendered literally into the SQL statement. This to support strict SQL-92 rules that are enforced by some platforms including MS-SQL and Sybase. In this model, bind parameters aren't allowed in the columns clause of a SELECT, nor are certain ambiguous expressions like "?=?". When this mode is enabled, the base compiler will render the binds as inline literals, but only across strings and numeric values. Other types such as dates will raise an error, unless the dialect subclass defines a literal rendering function for those. The bind parameter must have an embedded literal value already or an error is raised (i.e. won't work with straight bindparam('x')). Dialects can also expand upon the areas where binds are not accepted, such as within argument lists of functions (which don't work on MS-SQL when native SQL binding is used).
* - The visit_pool() method of Dialect is removed, and replaced withMike Bayer2010-03-151-0/+14
| | | | | | | | 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.
* - initial working version of sybase, with modifications to the transactionalMike Bayer2010-03-141-1/+5
| | | | | | | | | | model to accomodate Sybase's default mode of "no ddl in transactions". - identity insert not working yet. it seems the default here might be the opposite of that of MSSQL. - reflection will be a full rewrite - default DBAPI is python-sybase, well documented and nicely DBAPI compliant except for the bind parameter situation, where we have a straightforward workaround - full Sybase docs at: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0/title.htm
* oursql doesn't like the cursor being reused without fetch being finishedMike Bayer2010-03-121-13/+15
|
* - Added preliminary support for Oracle's WITH_UNICODEMike Bayer2010-03-121-1/+9
| | | | | | mode. At the very least this establishes initial support for cx_Oracle with Python 3. [ticket:1670]
* refine that a bitMike Bayer2010-03-111-20/+15
|
* adding windows-appropriate levels of pain to unicode handlingMike Bayer2010-03-111-2/+2
|
* add a third state to converts_unicode_strings - "conditional". at the momentMike Bayer2010-03-111-2/+18
| | | | this will have us do a check. i.e. for MSSQL where NVARCHAR is unicode and VARCHAR is not.
* - the execution sequence pulls all rowcount/last inserted IDMike Bayer2010-02-281-15/+21
| | | | | | | | info from the cursor before commit() is called on the DBAPI connection in an "autocommit" scenario. This helps mxodbc with rowcount and is probably a good idea overall. - cx_oracle wants list(), not tuple(), for empty execute. - cleaned up plain SQL param handling
* - simplify the OurSQL dialect regarding py3k, this version gives it a fairlyMike Bayer2010-02-281-15/+14
| | | | | | | fighting chance on python 3. there's an oursql bug where it can't raise an exception on executemany() correctly. - needed to add "plain_query" wrappers for all the reflection methods. not sure why this was not needed earlier.
* working on pyodbc / mxodbcMike Bayer2010-02-271-0/+5
|