Mike Bayer [Sat, 21 Apr 2007 23:29:03 +0000 (23:29 +0000)]
- informix support added ! courtesy James Zhang
- tweak to oracle default execution code to use local connection for compilation
- tweak to connection.execute_text() to generate None for parameters when no params sent
Jason Kirtland [Thu, 19 Apr 2007 23:44:26 +0000 (23:44 +0000)]
- Promoted mysql's dburl query string helper to util + fixed
- Coercing sqlite connect args provided in query string to their expected type
(e.g. 'timeout' as float, fixes #544)
- Coerce mysql's client_flag to int too
Jason Kirtland [Thu, 19 Apr 2007 19:07:51 +0000 (19:07 +0000)]
- fixed issue where slice assignment on relation properties truncates the relation (#529)
- fix for #530, don't require collection classes to respond to len requests
Mike Bayer [Wed, 18 Apr 2007 22:54:40 +0000 (22:54 +0000)]
- the "where" criterion of an update() and delete() now correlates
embedded select() statements against the table being updated or
deleted. this works the same as nested select() statement
correlation, and can be disabled via the correlate=False flag on
the embedded select().
Mike Bayer [Wed, 18 Apr 2007 22:33:53 +0000 (22:33 +0000)]
- fixed critical issue when, after options(eagerload()) is used,
the mapper would then always apply query "wrapping" behavior
for all subsequent LIMIT/OFFSET/DISTINCT queries, even if no
eager loading was applied on those subsequent queries.
Mike Bayer [Tue, 17 Apr 2007 20:49:35 +0000 (20:49 +0000)]
- the dialects within sqlalchemy.databases become a setuptools
entry points. loading the built-in database dialects works the
same as always, but if none found will fall back to trying
pkg_resources to load an external module [ticket:521]
Mike Bayer [Tue, 17 Apr 2007 00:21:25 +0000 (00:21 +0000)]
added "recreate()" argument to connection pool classes
this method is called when the invalidate() occurs for a disconnect condition,
so that the entire pool is recreated, thereby avoiding repeat errors on
remaining connections in the pool.
dispose() called as well (also fixed up) but cant guarantee all connections closed.
Mike Bayer [Mon, 16 Apr 2007 22:35:53 +0000 (22:35 +0000)]
- removed meaningless entity_name argument from session.delete()
- session.merge() propigates given entity_name to locate that mapper if the given object
is transient (and therefore has no entity_name)
- some fixes to MockEngine which still is mostly useless for most cases.
- unitofwork test used incorrect session.delete() signature
Mike Bayer [Sun, 15 Apr 2007 22:04:53 +0000 (22:04 +0000)]
- got unicode schemas to work with postgres
- unicode schema with mysql slightly improved, still cant do has_table
- got reflection of unicode schemas working with sqlite, pg, mysql
Mike Bayer [Fri, 13 Apr 2007 22:22:07 +0000 (22:22 +0000)]
- small fix to allow successive compiles of the same SELECT object
which features LIMIT/OFFSET. oracle dialect needs to modify
the object to have ROW_NUMBER OVER and wasn't performing
the full series of steps on successive compiles.
Mike Bayer [Wed, 11 Apr 2007 20:55:27 +0000 (20:55 +0000)]
- the "mini" column labels generated when using subqueries, which
are to work around glitchy SQLite behavior that doesnt understand
"foo.id" as equivalent to "id", are now only generated in the case
that those named columns are selected from (part of [ticket:513])
- MS-SQL better detects when a query is a subquery and knows not to
generate ORDER BY phrases for those [ticket:513]
Mike Bayer [Wed, 4 Apr 2007 23:06:39 +0000 (23:06 +0000)]
- some cleanup of reflection unit tests
- removed silly behavior where sqlite would reflect UNIQUE indexes
as part of the primary key (?!)
- added __contains__ support to ColumnCollection; contains_column() method should be removed
Mike Bayer [Tue, 3 Apr 2007 16:06:06 +0000 (16:06 +0000)]
for #516, moved the "disconnect check" step out of pool and back into base.py. dialects have
is_disconnect() method now. simpler design which also puts control of the ultimate "execute" call back into the hands of the dialects.
Mike Bayer [Mon, 2 Apr 2007 22:03:06 +0000 (22:03 +0000)]
- merged the patch from #516 + fixes
- improves the framework for auto-invalidation of connections that have
lost their underlying database - the error catching/invalidate
step is totally moved to the connection pool.
- added better condition checking for do_rollback() and do_commit() including
SQLError excepetion wrapping
Mike Bayer [Mon, 2 Apr 2007 21:36:11 +0000 (21:36 +0000)]
- merged the "execcontext" branch, refactors engine/dialect codepaths
- much more functionality moved into ExecutionContext, which impacted
the API used by dialects to some degree
- ResultProxy and subclasses now designed sanely
- merged patch for #522, Unicode subclasses String directly,
MSNVarchar implements for MS-SQL, removed MSUnicode.
- String moves its "VARCHAR"/"TEXT" switchy thing into
"get_search_list()" function, which VARCHAR and CHAR can override
to not return TEXT in any case (didnt do the latter yet)
- implements server side cursors for postgres, unit tests, #514
- includes overhaul of dbapi import strategy #480, all dbapi
importing happens in dialect method "dbapi()", is only called
inside of create_engine() for default and threadlocal strategies.
Dialect subclasses have a datamember "dbapi" referencing the loaded
module which may be None.
- added "mock" engine strategy, doesnt require DBAPI module and
gives you a "Connecition" which just sends all executes to a callable.
can be used to create string output of create_all()/drop_all().
Mike Bayer [Wed, 28 Mar 2007 07:19:14 +0000 (07:19 +0000)]
- column label and bind param "truncation" also generate
deterministic names now, based on their ordering within the
full statement being compiled. this means the same statement
will produce the same string across application restarts and
allowing DB query plan caching to work better.
- cleanup to sql.ClauseParameters since it was just falling
apart, API made more explicit
- many unit test tweaks to adjust for bind params not being
"pre" truncated, changes to ClauseParameters
Mike Bayer [Wed, 28 Mar 2007 01:39:58 +0000 (01:39 +0000)]
added label truncation for bind param names which was lost in the previous related commit.
added more tests plus test for column targeting with text() clause.
Mike Bayer [Tue, 27 Mar 2007 22:06:36 +0000 (22:06 +0000)]
- fixes [ticket:185], join object determines primary key and removes
columns that are FK's to other columns in the primary key collection.
- removed workaround code from query.py get()
- removed obsolete inheritance test from mapper
- added new get() test to inheritance.py for this particular issue
- ColumnCollection has nicer string method
Mike Bayer [Mon, 26 Mar 2007 19:59:39 +0000 (19:59 +0000)]
- improved/fixed custom collection classes when giving it "set"/
"sets.Set" classes or subclasses (was still looking for append()
methods on them during lazy loads)
- moved CustomCollectionsTest from unitofwork to relationships
- added more custom collections test to attributes module
Mike Bayer [Sat, 24 Mar 2007 19:24:27 +0000 (19:24 +0000)]
- column labels are now generated in the compilation phase, which
means their lengths are dialect-dependent. So on oracle a label
that gets truncated to 30 chars will go out to 63 characters
on postgres. Also, the true labelname is always attached as the
accessor on the parent Selectable so theres no need to be aware
of the genrerated label names [ticket:512].
- ResultProxy column targeting is greatly simplified, and relies
upon the ANSICompiler's column_labels map to translate the built-in
label on a _ColumnClause (which is now considered to be a unique
identifier of that column) to the label which was generated at compile
time.
- still need to put a baseline of ColumnClause targeting for
ResultProxy objects that originated from a textual query.
Mike Bayer [Thu, 22 Mar 2007 21:18:23 +0000 (21:18 +0000)]
- MetaData can bind to an engine either via "url" or "engine" kwargs
to constructor, or by using connect() method. BoundMetaData is
identical to MetaData except engine_or_url param is required.
DynamicMetaData is the same and provides thread-local connections
be default.
Mike Bayer [Wed, 21 Mar 2007 20:43:34 +0000 (20:43 +0000)]
- slightly better support for bind params as column clauses, either
via bindparam() or via literal(), i.e. select([literal('foo')])
- removed "table" argument from column(). this does not add the column
to the table anyway so was misleading.
- Select _exportable_columns() only exports Selectable instances
- Select uses _exportable_columns() when searching for engines
instead of _raw_columns for similar reasons (non selectables have no engine)
- _BindParamClause no longer has a _make_proxy(). its not a ColumnElement.
- _Label detects underlying column element and will generate its own
column()._make_proxy() if the element is not a ColumnElement. this
allows a Label to be declared for nearly anything and it can export
itself as a column on a containing Selectable.
Mike Bayer [Tue, 20 Mar 2007 15:27:34 +0000 (15:27 +0000)]
the "tack on the leftover tasks at the end" step of the "circular dependency sort"
makes a copy of those tasks with the circular_parent marked. this way the tasks
do not iterate through their child items polymorphically, which is necessary because
the "circular sort" stores individual subclass tasks separately (i.e. saving/deleting
should not traverse polymorhically for those tasks)
Mike Bayer [Sun, 18 Mar 2007 22:35:19 +0000 (22:35 +0000)]
- added db modules to genned docstrings
- had to tweak out latest MS-SQL module change. cant do ImportErrors right now until module
importing is moved to the connection phase across all dialects.
- took out "his" from url docstrings
- postgres doesnt do an import *
Mike Bayer [Sun, 18 Mar 2007 21:45:55 +0000 (21:45 +0000)]
- check for tables in the primaryjoin/secondaryjoin that arent parent of parent/child mappers.
dont include those clauses when looking for foreign_keys (which also takes care of remote_side).
if those cols are present in foreign_keys, lazyloader makes binds out of them and tries to
target those columns on the mapper, raising either the "conflicting column" error if they have the same
name, or the "cant find column on mapping" if it has a unique name. added tests for both.
Mike Bayer [Sat, 17 Mar 2007 20:46:52 +0000 (20:46 +0000)]
- flush fixes on self-referential relationships that contain references
to other instances outside of the cyclical chain, when the initial
self-referential objects are not actually part of the flush
Rick Morrison [Thu, 15 Mar 2007 02:31:15 +0000 (02:31 +0000)]
MSSQL now passes still more unit tests [ticket:481]
Fix to null FLOAT fields in mssql-trusted.patch
MSSQL: LIMIT with OFFSET now raises an error
MSSQL: can now specify Windows authorization
MSSQL: ignores seconds on DATE columns (DATE fix, part 1)
Mike Bayer [Wed, 14 Mar 2007 23:48:07 +0000 (23:48 +0000)]
- eager loading will not "aliasize" "order by" clauses that were placed
in the select statement by something other than the eager loader
itself, to fix possibility of dupe columns as illustrated in
[ticket:495]. however, this means you have to be more careful with
the columns placed in the "order by" of Query.select(), that you have
explicitly named them in your criterion (i.e. you cant rely on the
eager loader adding them in for you)
- query._join_to (which powers join, join_via, etc) properly takes
secondary table into account when constructing joins
Mike Bayer [Tue, 13 Mar 2007 03:45:28 +0000 (03:45 +0000)]
- added a handy multi-use "identity_key()" method to Session, allowing
the generation of identity keys for primary key values, instances,
and rows, courtesy Daniel Miller
Mike Bayer [Sun, 11 Mar 2007 20:52:02 +0000 (20:52 +0000)]
- for hackers, refactored the "visitor" system of ClauseElement and
SchemaItem so that the traversal of items is controlled by the
ClauseVisitor itself, using the method visitor.traverse(item).
accept_visitor() methods can still be called directly but will
not do any traversal of child items. ClauseElement/SchemaItem now
have a configurable get_children() method to return the collection
of child elements for each parent object. This allows the full
traversal of items to be clear and unambiguous (as well as loggable),
with an easy method of limiting a traversal (just pass flags which
are picked up by appropriate get_children() methods). [ticket:501]
- accept_schema_visitor() methods removed, replaced with
get_children(schema_visitor=True)
- various docstring/changelog cleanup/reformatting