Mike Bayer [Thu, 11 Mar 2010 18:01:04 +0000 (18:01 +0000)]
- fix the sqlalchemy.test.schema.Column function to work with copies
- add sequences to new associationproxy tests
- test/ext passes 100% on oracle here
Mike Bayer [Thu, 11 Mar 2010 15:27:18 +0000 (10:27 -0500)]
- Oracle 'DATE' now does not perform any result processing,
as the DATE type in Oracle stores full date+time objects,
that's what you'll get. Note that the generic types.Date
type *will* still call value.date() on incoming values,
however. When reflecting a table, the reflected type
will be 'DATE'.
Mike Bayer [Wed, 10 Mar 2010 23:29:32 +0000 (18:29 -0500)]
- emphasized query.join() in ORM tutorial as per [ticket:1708]
- cleaned up tutorial w.r.t. eagerload, added a section for contains_eager as this function
is equally important
- added better linkages in sqlalchemy.orm reference documentation, updated antiquated
docs for contains_eager(), got aliased()/AliasedClass documented as well as Sphinx will
allow us
Mike Bayer [Tue, 9 Mar 2010 22:46:00 +0000 (17:46 -0500)]
- moved the logic within _BindParamClause which decides about coercing the bind's type
based on the compared type into AbstractType. The new method is called _coerce_compared_value()
and receives the operator and the raw python value to be coerced. TypeDecorator
overrides this to provude the "old" 0.5 behavior of coercing the other side of the expression
unconditonally.
- added docs to TypeDecorator attempting to explain this though they are a little verbose.
- added caveats to Interval, which in "non-native" mode can't really handle proper expression behavior. the "typing" would have to move into the compiler, such that on a DB like SQLite we're actually wrapping left/right side into its epoch functions, etc., its a big job. current infrastructure, as powerful as it is, still isn't at that level.
Michael Trier [Mon, 1 Mar 2010 02:57:47 +0000 (02:57 +0000)]
And more wonderfully crafted documentation changes to link function/method names to their appropriate definitions in the API docs. Thank you Diana Clarke. Refs #1703.
Mike Bayer [Mon, 1 Mar 2010 01:00:12 +0000 (01:00 +0000)]
- adjusted the literal coercion rules to take the left side's type into account, if it is
compatible with what was found for the right, so that things like oracle CHAR conversions
work.
- oracle dialect specific tests pass again.
Mike Bayer [Sun, 28 Feb 2010 23:51:54 +0000 (23:51 +0000)]
- the execution sequence pulls all rowcount/last inserted ID
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
Mike Bayer [Sun, 28 Feb 2010 20:12:43 +0000 (20:12 +0000)]
- simplify the OurSQL dialect regarding py3k, this version gives it a fairly
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.
Mike Bayer [Sun, 28 Feb 2010 17:43:10 +0000 (17:43 +0000)]
- orm: Removed a lot of logging that nobody really cares about,
logging that remains will respond to live changes in the
log level. No significant overhead is added. [ticket:1719]
- engine: Opened up logging a bit such that isEnabledFor() is called
more often, so that changes to the log level for engine/pool
will be reflected on next connect. This adds a small
amount of method call overhead. It's negligible and will make
life a lot easier for all those situations when logging
just happens to be configured after create_engine() is called.
[ticket:1719]
Mike Bayer [Sat, 27 Feb 2010 00:44:26 +0000 (00:44 +0000)]
- threadlocal engine wasn't properly closing the connection
upon close() - fixed that.
- Transaction object doesn't rollback or commit if it isn't
"active", allows more accurate nesting of begin/rollback/commit.
- Added basic support for mxODBC [ticket:1710].
- Python unicode objects as binds result in the Unicode type,
not string, thus eliminating a certain class of unicode errors
on drivers that don't support unicode binds.
Mike Bayer [Fri, 26 Feb 2010 17:50:34 +0000 (17:50 +0000)]
- the "scale" argument of the Numeric() type is honored when
coercing a returned floating point value into a string
on its way to Decimal - this allows accuracy to function
on SQLite, MySQL. [ticket:1717]
Mike Bayer [Thu, 25 Feb 2010 23:15:39 +0000 (23:15 +0000)]
- merge -r6823:6841 of branches/chrisw_mixin
- declarative now accepts mixin classes directly, as a means
to provide common functional and column-based elements on
all subclasses, as well as a means to propagate a fixed
set of __table_args__ or __mapper_args__ to subclasses.
For custom combinations of __table_args__/__mapper_args__ from
an inherited mixin to local, descriptors can now be used.
New details are all up in the Declarative documentation.
Thanks to Chris Withers for putting up with my strife
on this. [ticket:1707]
Mike Bayer [Thu, 25 Feb 2010 22:16:34 +0000 (22:16 +0000)]
- walk back r6851 slightly. Still emit a warning when the Unicode or UnicodeText type
is passed a bytestring even if the backend accepts unicodes directly.
Mike Bayer [Thu, 25 Feb 2010 22:00:58 +0000 (22:00 +0000)]
- The assert_unicode flag is deprecated. SQLAlchemy will raise
a warning in all cases where it is asked to encode a non-unicode
Python string, and will do nothing for DBAPIs that already
accept Python unicode objects.
Mike Bayer [Wed, 24 Feb 2010 00:43:09 +0000 (00:43 +0000)]
- A major fix in query.join(), when the "on" clause is an
attribute of an aliased() construct, but there is already
an existing join made out to a compatible target, query properly
joins to the right aliased() construct instead of sticking
onto the right side of the existing join. [ticket:1706]
Mike Bayer [Tue, 23 Feb 2010 22:15:09 +0000 (22:15 +0000)]
- "out" parameters require a type that is supported by
cx_oracle. An error will be raised if no cx_oracle
type can be found.
- Column() requires a type if it has no foreign keys (this is
not new). An error is now raised if a Column() has no type
and no foreign keys. [ticket:1705]
Mike Bayer [Tue, 23 Feb 2010 19:53:07 +0000 (19:53 +0000)]
- Added "unicode_errors" parameter to String, Unicode, etc.
Behaves like the 'errors' keyword argument to
the standard library's string.decode() functions. This flag
requires that `convert_unicode` is set to `"force"` - otherwise,
SQLAlchemy is not guaranteed to handle the task of unicode
conversion. Note that this flag adds significant performance
overhead to row-fetching operations for backends that already
return unicode objects natively (which most DBAPIs do). This
flag should only be used as an absolute last resort for reading
strings from a column with varied or corrupted encodings,
which only applies to databases that accept invalid encodings
in the first place (i.e. MySQL. *not* PG, Sqlite, etc.)
Mike Bayer [Tue, 23 Feb 2010 00:57:08 +0000 (00:57 +0000)]
- a change to the previous __mapper_args__ commit.
- the __mapper_args__ dict is copied when propagating to a subclass,
and is taken straight off the class __dict__ to avoid any
propagation from the parent. mapper inheritance already
propagates the things you want from the parent mapper.
[ticket:1393]