Mike Bayer [Sat, 14 Oct 2006 07:57:12 +0000 (07:57 +0000)]
a simplification to syncrule generation, which also allows more flexible configuration
of which columns are to be involved in the synchronization via foreignkey property.
foreignkey param is a little more important now and should have its role clarified
particularly for self-referential mappers.
Mike Bayer [Fri, 13 Oct 2006 16:38:21 +0000 (16:38 +0000)]
- sync checks destination column for primary key status, will not set it to None in that case
- dependency non-passively loads child items for many-to-one post update check
Mike Bayer [Sun, 8 Oct 2006 19:30:00 +0000 (19:30 +0000)]
- mapper.save_obj() now functions across all mappers in its polymorphic
series, UOWTask calls mapper appropriately in this manner
- polymorphic mappers (i.e. using inheritance) now produces INSERT
statements in order of tables across all inherited classes
[ticket:321]
Mike Bayer [Sun, 8 Oct 2006 02:46:40 +0000 (02:46 +0000)]
- the "foreign_key" attribute on Column and ColumnElement in general
is deprecated, in favor of the "foreign_keys" list/set-based attribute,
which takes into account multiple foreign keys on one column.
"foreign_key" will return the first element in the "foreign_keys" list/set
or None if the list is empty.
- added a user test to the relationships test, testing various new things this
change allows
Mike Bayer [Tue, 3 Oct 2006 23:38:48 +0000 (23:38 +0000)]
- "custom list classes" is now implemented via the "collection_class"
keyword argument to relation(). the old way still works but is
deprecated [ticket:212]
Mike Bayer [Tue, 3 Oct 2006 23:00:04 +0000 (23:00 +0000)]
- Function objects know what to do in a FROM clause now. their
behavior should be the same, except now you can also do things like
select(['*'], from_obj=[func.my_function()]) to get multiple
columns from the result, or even use sql.column() constructs to name the
return columns [ticket:172]. generally only postgres understands the
syntax (and possibly oracle).
Mike Bayer [Tue, 3 Oct 2006 21:47:48 +0000 (21:47 +0000)]
- added auto_setinputsizes=False to oracle dialect. if true, all executions will get setinputsizes called ahead of time.
- some tweaks to the types unittest for oracle. oracle types still need lots more work.
Mike Bayer [Tue, 3 Oct 2006 21:08:14 +0000 (21:08 +0000)]
- removed "extension()" MapperOption
- TypeEngine objects can report on DBAPI types
- added set_input_sizes() to default dialect
- oracle dialect gets Timestamp type added, may need to call
set_input_sizes() to make it work with sub-second resolution [ticket:304]
Mike Bayer [Tue, 3 Oct 2006 16:47:14 +0000 (16:47 +0000)]
- merged loader_strategies branch into trunk.
- this is a wide refactoring to "attribute loader" and "options" architectures.
ColumnProperty and PropertyLoader define their loading behaivor via switchable
"strategies", and MapperOptions no longer use mapper/property copying
in order to function; they are instead propigated via QueryContext
and SelectionContext objects at query/instnaces time.
All of the copying of mappers and properties that was used to handle
inheritance as well as options() has been removed and the structure
of mappers and properties is much simpler and more clearly laid out.
Mike Bayer [Sat, 30 Sep 2006 16:26:52 +0000 (16:26 +0000)]
- fixed condition that occurred during reflection when a primary key
column was explciitly overridden, where the PrimaryKeyConstraint would
get both the reflected and the programmatic column doubled up
Mike Bayer [Sat, 30 Sep 2006 04:40:15 +0000 (04:40 +0000)]
- internal refactoring to mapper instances() method to use a
SelectionContext object to track state during the operation.
SLIGHT API BREAKAGE: the append_result() and populate_instances()
methods on MapperExtension have a slightly different method signature
now as a result of the change; hoping that these methods are not
in widespread use as of yet.
Mike Bayer [Thu, 28 Sep 2006 05:26:26 +0000 (05:26 +0000)]
- more adjustments to the eager load table finder to work with existing mappings
against selects and query-created limit/offset subselects
- added eagertest3 to orm/alltests.py
Mike Bayer [Thu, 28 Sep 2006 04:53:00 +0000 (04:53 +0000)]
- added test suite to test improved from_obj/join behavior with Query/eagerloading/SelectResults
- EagerLoader looks more carefully for the correct Table/Join/FromClause to bind its outer join onto
- sqlite boolean datatype converts bind params from python booleans to integer
- took out assertion raise from 'name' property of CompoundSelect
Mike Bayer [Thu, 28 Sep 2006 01:46:16 +0000 (01:46 +0000)]
- pool will auto-close open cursors, or can be configured to raise an error instead
- consolidated scalar() calls into ResultProxy scalar(), fixed ResultProxy scalar() to
apply typing rules
- general de-cruftification of ClauseElement/Compiled (yes i know theres crufty things everywhere)
Mike Bayer [Wed, 27 Sep 2006 07:08:26 +0000 (07:08 +0000)]
- specifying joins in the from_obj argument of query.select() will
replace the main table of the query, if the table is somewhere within
the given from_obj. this makes it possible to produce custom joins and
outerjoins in queries without the main table getting added twice.
[ticket:315]
- added join_to and outerjoin_to transformative methods to SelectResults,
to build up join/outerjoin conditions based on property names. also
added select_from to explicitly set from_obj parameter.
- factored "results" arrays from the mapper test suite and into the
"tables" mapper
- added "viewonly" param to docs
Mike Bayer [Wed, 27 Sep 2006 05:08:22 +0000 (05:08 +0000)]
- added an automatic "row switch" feature to mapping, which will
detect a pending instance/deleted instance pair with the same
identity key and convert the INSERT/DELETE to a single UPDATE
- "association" mappings simplified to take advantage of
automatic "row switch" feature
- fixes [ticket:311]
Mike Bayer [Sun, 24 Sep 2006 23:59:22 +0000 (23:59 +0000)]
- logging is now implemented via standard python "logging" module.
"echo" keyword parameters are still functional but set/unset
log levels for their respective classes/instances. all logging
can be controlled directly through the Python API by setting
INFO and DEBUG levels for loggers in the "sqlalchemy" namespace.
class-level logging is under "sqlalchemy.<module>.<classname>",
instance-level logging under "sqlalchemy.<module>.<classname>.<hexid>".
Test suite includes "--log-info" and "--log-debug" arguments
which work independently of --verbose/--quiet. Logging added
to orm to allow tracking of mapper configurations, row iteration
fixes [ticket:229] [ticket:79]
Mike Bayer [Sat, 23 Sep 2006 23:03:50 +0000 (23:03 +0000)]
descriptive error message when an executioncontext-requiring call is called off a ResultProxy which was created via literal statement execution and therefore does not have an execution context.
Mike Bayer [Sat, 23 Sep 2006 21:02:33 +0000 (21:02 +0000)]
- added "mutable" flag to PickleType, set to False to allow old (faster) behavior
- fix attribute unit test
- attributes have explicit flag for "mutable_scalars", propigated by ColumnProperty
Mike Bayer [Sat, 23 Sep 2006 20:26:20 +0000 (20:26 +0000)]
- added "pickleable" module to test suite to have cPickle-compatible
test objects
- added copy_function, compare_function arguments to InstrumentedAttribute
- added MutableType mixin, copy_value/compare_values methods to TypeEngine,
PickleType
- ColumnProperty and DeferredProperty propigate the TypeEngine copy/compare
methods to the attribute instrumentation
- cleanup of UnitOfWork, removed unused methods
- UnitOfWork "dirty" list is calculated across the total collection of persistent
objects when called, no longer has register_dirty.
- attribute system can still report "modified" status fairly quickly, but does
extra work for InstrumentedAttributes that have detected a "mutable" type where
catching the __set__() event is not enough (i.e. PickleTypes)
- attribute tracking modified to be more intelligent about detecting
changes, particularly with mutable types. TypeEngine objects now
take a greater role in defining how to compare two scalar instances,
including the addition of a MutableType mixin which is implemented by
PickleType. unit-of-work now tracks the "dirty" list as an expression
of all persistent objects where the attribute manager detects changes.
The basic issue thats fixed is detecting changes on PickleType
objects, but also generalizes type handling and "modified" object
checking to be more complete and extensible.
Mike Bayer [Sat, 23 Sep 2006 17:21:56 +0000 (17:21 +0000)]
- added autoincrement=True to Column; will disable schema generation
of SERIAL/AUTO_INCREMENT/identity seq for postgres/mysql/mssql if
explicitly set to False. #303
Mike Bayer [Sat, 23 Sep 2006 00:06:10 +0000 (00:06 +0000)]
- fixed unfortunate mutating-dictionary glitch from previous checkin
- added "batch=True" flag to mapper; if False, save_obj
will fully save one object at a time including calls
to before_XXXX and after_XXXX
Mike Bayer [Fri, 22 Sep 2006 00:33:44 +0000 (00:33 +0000)]
- moved selectresults test from orm to ext package
- renamed objectstore test suite to unitofwork
- added additional "eagerdegrade" tests to mapper, to test fixes from #308
Mike Bayer [Thu, 21 Sep 2006 20:26:33 +0000 (20:26 +0000)]
- adjustments to eager loading so that its "eager chain" is
kept separate from the normal mapper setup, thereby
preventing conflicts with lazy loader operation, fixes
[ticket:308]
Mike Bayer [Thu, 21 Sep 2006 17:15:33 +0000 (17:15 +0000)]
- BooleanExpression includes new "negate" argument to specify
the appropriate negation operator if one is available.
- calling a negation on an "IN" or "IS" clause will result in
"NOT IN", "IS NOT" (as opposed to NOT (x IN y)).