Mike Bayer [Tue, 17 Oct 2006 02:03:00 +0000 (02:03 +0000)]
reorganizing classnames a bit, flagging "private" classes in the sql package,
getting the generated docs to look a little nicer.
fixes to extensions, sqlsoup etc. to be compatible with recent API tweaks
Mike Bayer [Mon, 16 Oct 2006 23:34:23 +0000 (23:34 +0000)]
- added "column_prefix=None" argument to mapper; prepends the
given string (typically '_') to column-based attributes automatically
set up from the mapper's Table
Mike Bayer [Sun, 15 Oct 2006 00:07:06 +0000 (00:07 +0000)]
- ForeignKey(Constraint) supports "use_alter=True", to create/drop a foreign key
via ALTER. this allows circular foreign key relationships to be set up.
Mike Bayer [Sat, 14 Oct 2006 21:58:04 +0000 (21:58 +0000)]
- a fair amount of cleanup to the schema package, removal of ambiguous
methods, methods that are no longer needed. slightly more constrained
useage, greater emphasis on explicitness.
- table_iterator signature fixup, includes fix for [ticket:288]
- the "primary_key" attribute of Table and other selectables becomes
a setlike ColumnCollection object; is no longer ordered or numerically
indexed. a comparison clause between two pks that are derived from the
same underlying tables (i.e. such as two Alias objects) can be generated
via table1.primary_key==table2.primary_key
- append_item() methods removed from Table and Column; preferably
construct Table/Column/related objects inline, but if needed use
append_column(), append_foreign_key(), append_constraint(), etc.
- table.create() no longer returns the Table object, instead has no
return value. the usual case is that tables are created via metadata,
which is preferable since it will handle table dependencies.
- added UniqueConstraint (goes at Table level), CheckConstraint
(goes at Table or Column level) fixes [ticket:217]
- index=False/unique=True on Column now creates a UniqueConstraint,
index=True/unique=False creates a plain Index,
index=True/unique=True on Column creates a unique Index. 'index'
and 'unique' keyword arguments to column are now boolean only; for
explcit names and groupings of indexes or unique constraints, use the
UniqueConstraint/Index constructs explicitly.
- relationship of Metadata/Table/SchemaGenerator/Dropper has been
improved so that the schemavisitor receives the metadata object
for greater control over groupings of creates/drops.
- added "use_alter" argument to ForeignKey, ForeignKeyConstraint,
but it doesnt do anything yet. will utilize new generator/dropper
behavior to implement.
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.