Mike Bayer [Sun, 29 Apr 2007 22:26:39 +0000 (22:26 +0000)]
- restored old "column_property()" ORM function (used to be called
"column()") to force any column expression to be added as a property
on a mapper, particularly those that aren't present in the mapped
selectable. this allows "scalar expressions" of any kind to be
added as relations (though they have issues with eager loads).
Mike Bayer [Sun, 29 Apr 2007 21:33:05 +0000 (21:33 +0000)]
- the label() method on ColumnElement will properly propigate the
TypeEngine of the base element out to the label, including a label()
created from a scalar=True select() statement.
Mike Bayer [Sun, 29 Apr 2007 20:08:55 +0000 (20:08 +0000)]
- mysql uses "DESCRIBE [<schemaname>].<tablename>", catching exceptions
if table doesnt exist, in order to determine if a table exists.
this supports unicode table names as well as schema names. tested
with MySQL5 but should work with 4.1 series as well. (#557)
Rick Morrison [Sun, 29 Apr 2007 20:00:43 +0000 (20:00 +0000)]
- mssql: replace "select @@identity" with "select @@scope_identity". Should help avoid returning wrong ID when insert triggers are used. Also add unit test (thanks paj)
- mssql: if no db-api module specified, probe in the order [pyodbc, pymssql, adodbapi]
Mike Bayer [Fri, 27 Apr 2007 17:19:39 +0000 (17:19 +0000)]
- the usual adjustments to relationships between inheriting mappers,
in this case establishing relation()s to subclass mappers where
the join conditions come from the superclass' table
- specifically, places where PropertyLoader limits its search to mapper.local_table had to be expanded
to search separately within mapper.mapped_table as well. in the case of determining primary/secondaryjoin, it starts more specifically first with local table then out to mapped table if not found. in the case of determining direction, it starts more generally with mapped table, then if ambiguous direction, goes to the local tables.
Mike Bayer [Thu, 26 Apr 2007 18:04:09 +0000 (18:04 +0000)]
- generative test doesnt apply to mysql, others
- refactoring to unitofwork.py. low-hanging cruft
removed, UOWTask structure simplified particuularly with the
per-instance sort phase, most methods docstring'ed extensively.
this is a merge from the 'uowsimplify' branch. (only slightly simpler, tho)
- mapper delete_obj works across multiple mappers to be consistent
with the operation of save_obj
Mike Bayer [Thu, 26 Apr 2007 16:25:13 +0000 (16:25 +0000)]
- _with_parent_criterion generalized into _with_lazy_criterion
- _create_lazy_clause now includes a 'reverse_direction' flag to generate lazy criterion
in from parent->child or vice versa
- changed join_by() in query to use the "reverse" _create_lazy_clause for instance comparisons
so conditions like AND can work [ticket:554]
Mike Bayer [Tue, 24 Apr 2007 21:33:07 +0000 (21:33 +0000)]
- fix to case() construct to propigate the type of the first
WHEN condition as the return type of the case statement
- various unit test tweaks to get oracle working
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.