Commit Graph

5242 Commits

Author SHA1 Message Date
Mike Bayer ddecef1071 - fixed bug where delete-orphan basically didn't work with many-to-many relationships [ticket:427],
backref presence generally hid the symptom
2007-01-19 03:18:46 +00:00
Mike Bayer 49f707b79c added testcase for upcoming ticket 2007-01-19 02:44:47 +00:00
Mike Bayer 37a61a1b49 - another fix to subquery correlation so that a subquery which has only one FROM
element will *not* correlate that single element, since at least one FROM element is
required in a query.
2007-01-19 02:19:38 +00:00
Mike Bayer bfbf626317 - some deeper error checking when compiling relations, to detect an ambiguous "primaryjoin"
in the case that both sides of the relationship have foreign key references in the primary
 join condition
2007-01-18 03:33:13 +00:00
Mike Bayer 35fcfbc083 added testcase to ensure that type gets propigated from scalar subquery to its label 2007-01-16 23:23:19 +00:00
Mike Bayer ca92a81191 - added optional constructor to sql.ColumnCollection
- mapper sets its "primary_key" attribute to be the ultimately decided primary_key column collection post-compilation
- added compare() method to MapperProperty, defines a comparison operation of the columns represented by the property to some value
- all the above combines into today's controversial feature: saying query.select_by(somerelationname=someinstance) will create the join of the primary key columns represented by "somerelationname"'s mapper to the actual primary key in "someinstance".
- docs for the above
2007-01-15 21:54:16 +00:00
Mike Bayer 16f24ebbfc - default cascade is "save-update, merge"
- added another merge unit test
2007-01-14 21:10:40 +00:00
Mike Bayer 437f1ce670 - postgres cursor option is now server_side_cursors=False; some users get bad results using them
so theyre off by default
- type system slightly modified to support TypeDecorators that can be overridden by the dialect
- added an NVarchar type to mssql (produces NVARCHAR), also MSUnicode which provides Unicode-translation
for the NVarchar regardless of dialect convert_unicode setting.
2007-01-14 20:21:36 +00:00
Mike Bayer 5b4871f436 - basic idea of "session.merge()" actually implemented. needs more testing. 2007-01-13 01:39:15 +00:00
Jonathan Ellis cd2fe94b14 add test for max_order non_primary mapper from the list today 2007-01-09 07:07:55 +00:00
Mike Bayer a4c73cc8ae - the "op()" function is now treated as an "operation", rather than a "comparison".
the difference is, an operation produces a BinaryExpression from which further operations
  can occur whereas comparison produces the more restrictive BooleanExpression
2007-01-08 19:09:02 +00:00
Mike Bayer 1a5ba21076 - added a mutex to the mapper compilation step. ive been reluctant to add any kind
of threading anything to SA but this is one spot that its its really needed since mappers
are typically "global", and while their state does not change during normal operation, the
initial compilation step does modify internal state significantly, and this step usually
occurs not at module-level initialization time (unless you call compile()) but at first-request
time
- added "compile_mappers()" function as a shortcut to compiling all mappers
2007-01-06 20:32:47 +00:00
Mike Bayer e1ceee15cd - added an error message if you actually try to modify primary key values on an entity
and then flush it.
2007-01-06 03:33:53 +00:00
Mike Bayer 4771a156a3 - fix to post_update to insure rows are updated even for non insert/delete scenarios
[ticket:413]
2007-01-05 04:56:57 +00:00
Mike Bayer 6f131f00c6 - fixed bug in mapper refresh/expire whereby eager loaders didnt properly re-populate
item lists [ticket:407]
2007-01-02 19:33:41 +00:00
Mike Bayer 6bc79c98b7 - invalid options sent to 'cascade' string will raise an exception [ticket:406] 2007-01-02 03:39:26 +00:00
Mike Bayer 5369b3df8c - fix to correlation of subqueries when the column list of the select statement
is constructed with individual calls to append_column(); this fixes an ORM
bug whereby nested select statements were not getting correlated with the
main select generated by the Query object.
2006-12-28 00:27:58 +00:00
Mike Bayer dadf1c3792 - fix to MapperExtension create_instance so that entity_name properly associated
with new instance
2006-12-19 20:52:32 +00:00
Mike Bayer 422558bc5d fix to the fix for [ticket:396] plus a unit test 2006-12-15 01:07:05 +00:00
Mike Bayer 8a59bbed49 added additional unit test to test that commit errors are detected, rollback occurs in an except: 2006-12-14 23:10:10 +00:00
Mike Bayer 6dd59b1994 added InnoDB for mysql so that all tranactional tests pass for mysql 2006-12-14 23:03:43 +00:00
Mike Bayer e1a52eb7df - patch that makes MySQL rowcount work correctly! [ticket:396] 2006-12-13 21:06:38 +00:00
Mike Bayer 51ece86c13 - fixes to passive_deletes flag, lazy=None (noload) flag
- added example/docs for dealing with large collections
- added object_session() method to sqlalchemy namespace
2006-12-12 19:22:28 +00:00
Mike Bayer d56a50eb70 - support for None as precision/length in numeric types for postgres, sqlite, mysql
- postgres reflection fixes: [ticket:349] [ticket:382]
2006-12-09 03:21:18 +00:00
Mike Bayer 307726dfd9 - unit test for strong refs
- unit test to test [ticket:354]
2006-12-09 02:46:09 +00:00
Mike Bayer 3d45d2195b - identity map in Session is by default *no longer weak referencing*.
to have it be weak referencing, use create_session(weak_identity_map=True)
- some fixes to OrderedProperties
2006-12-09 01:08:25 +00:00
Mike Bayer 6d5786c1c2 docs/examples/unittests for remote_side 2006-12-08 20:50:48 +00:00
Mike Bayer e249e56cb9 - fix to connection pool _close() to properly clean up, fixes
MySQL synchronization errors [ticket:387]
2006-12-08 18:47:20 +00:00
Mike Bayer 054713d644 made backrefs aware of "post_update" and "viewonly" so it doesnt have to be explicitly propigated; also backrefs shouldnt fire off in a post_update situation. 2006-12-05 03:16:35 +00:00
Mike Bayer 18ff5f572f added 'remote_side' functionality to lazy clause generation 2006-12-02 23:36:59 +00:00
Mike Bayer a97a1fcad4 - added "remote_side" argument to relation(), used only with self-referential
mappers to force the direction of the parent/child relationship.  replaces
the usage of the "foreignkey" parameter for "switching" the direction;
while "foreignkey" can still be used to "switch" the direction of a parent/
child relationship, this usage is deprecated; "foreignkey" should always
indicate the actual foreign key columns from now on.
2006-12-02 05:59:50 +00:00
Mike Bayer 0ab287b039 added mass eagerloading profile, debug log in EagerLoader conditional based on flag 2006-12-01 19:45:04 +00:00
Mike Bayer 8f8afe9259 added conditional flag to debug log statements in mapper so that string formats dont occur
updated massload test to work with 0.3
2006-12-01 18:41:33 +00:00
Mike Bayer 117d6eb521 - improved support for disabling save-update cascade via cascade="none" etc. 2006-11-30 00:08:46 +00:00
Mike Bayer 13d989b2d0 - sending a selectable to an IN no longer creates a "union" out of multiple
selects; only one selectable to an IN is allowed now (make a union yourself
if union is needed; explicit better than implicit, dont guess, etc.)
2006-11-29 22:13:58 +00:00
Mike Bayer 6bba73a9f3 - fix to session.update() to preserve "dirty" status of incoming object 2006-11-29 21:50:45 +00:00
Mike Bayer 00da425b07 - added extra check to "stop" cascading on save/update/save-update if
an instance is detected to be already in the session.
2006-11-29 17:16:41 +00:00
Mike Bayer b6b0130646 - made kwargs parsing to Table strict; removed various obsoluete "redefine=True" kw's from the unit tests
- documented instance variables in ANSICompiler
- fixed [ticket:120], adds "inline_params" set to ANSICompiler which DefaultDialect picks up on when
determining defaults.  added unittests to query.py
- additionally fixed up the behavior of the "values" parameter on _Insert/_Update
- more cleanup to sql/Select - more succinct organization of FROM clauses, removed silly _process_from_dict
methods and JoinMarker object
2006-11-26 02:36:27 +00:00
Mike Bayer 19fcb943c4 - cleanup on some instance vars in Select (is_scalar, is_subquery, _froms is __froms, removed unused 'nowait', '_text', etc)
- cleaned up __repr__ on Column, AbstractTypeEngine
- added standalone intersect(_all), except(_all) functions, unit tests illustrating nesting patterns [ticket:247]
2006-11-25 21:32:26 +00:00
Mike Bayer 8a2ed6de4f fix to oracle types test, added RAW type [ticket:378] 2006-11-21 22:20:31 +00:00
Mike Bayer cf8e9d1db3 [ticket:374] [ticket:377] [ticket:375], small fix to mutable types unit test 2006-11-21 21:55:15 +00:00
Mike Bayer 4ae341fc94 added extra pickle unittest to insure update occurs/doesnt occur appropriately 2006-11-17 17:03:17 +00:00
Mike Bayer ecee1fb16c - create_engine() reworked to be strict about incoming **kwargs. all keyword
arguments must be consumed by one of the dialect, connection pool, and engine
constructors, else a TypeError is thrown which describes the full set of
invalid kwargs in relation to the selected dialect/pool/engine configuration.
2006-11-12 20:50:51 +00:00
Mike Bayer 2d4e0d27dc further refactoring of topological sort for clarity 2006-11-11 03:03:55 +00:00
Mike Bayer b547f30d28 more fixes to topological sort with regards to cycles, fixes [ticket:365] 2006-11-11 01:34:41 +00:00
Mike Bayer 4cbbf7725a - "delete-orphan" for a certain type can be set on more than one parent class;
the instance is an "orphan" only if its not attached to *any* of those parents
- better check for endless recursion in eagerloader.process_row
2006-11-10 00:46:57 +00:00
Mike Bayer ef48ddc503 - fix to subtle condition in topological sort where a node could appear twice,
for [ticket:362]
2006-11-04 06:11:21 +00:00
Mike Bayer 0306822526 - improvement to single table inheritance to load full hierarchies beneath
the target class
2006-11-03 19:57:39 +00:00
Mike Bayer aeb8c429bf - implemented from_obj argument for query.count, improves count function
on selectresults [ticket:325]
2006-11-02 21:31:56 +00:00
Mike Bayer ed33944f31 - fixed bug in circular dependency sorting at flush time; if object A
contained a cyclical many-to-one relationship to object B, and object B
was just attached to object A, *but* object B itself wasnt changed,
the many-to-one synchronize of B's primary key attribute to A's foreign key
attribute wouldnt occur.  [ticket:360]
2006-11-01 03:30:16 +00:00