Commit Graph

5242 Commits

Author SHA1 Message Date
Mike Bayer c858ba70b1 reorganized SingletonThreadPool to return distinct connections in the same thread; use_threadlocal behavior is now switchable 2006-03-16 19:09:53 +00:00
Mike Bayer bbf9f191ec fixed attributes bug where if an object is committed, its lazy-loaded list got
blown away if it hadnt been loaded
2006-03-14 16:56:05 +00:00
Mike Bayer ae15f93f8d added scalar subqueries within the column clause of another select 2006-03-13 17:16:52 +00:00
Mike Bayer 1fc3d22655 oracle is requiring dictionary params to be in a clean dict, added conversion
some fixes to unit tests
2006-03-13 02:00:21 +00:00
Mike Bayer a579e8f687 small tweak to select in order to fix [ticket:112]...the exported columns when doing select on a select() will be the column names, not the keys. this is with selects that have use_labels=False. which makes sense since using the "key" and not the name implies a label has to be used. 2006-03-13 01:13:47 +00:00
Mike Bayer 8690e2e303 tweak to mysql default test 2006-03-13 01:06:33 +00:00
Mike Bayer c5e1abc7f7 refactor to Compiled.get_params() to return new ClauseParameters object, a more intelligent bind parameter dictionary that does type conversions late and preserves the unconverted value; used to fix mappers not comparing correct value in post-fetch [ticket:110]
removed pre_exec assertion from oracle/firebird regarding "check for sequence/primary key value"
fix to Unicode type to check for null, fixes [ticket:109]
create_engine() now uses genericized parameters; host/hostname, db/dbname/database, password/passwd, etc. for all engine connections
fix to select([func(column)]) so that it creates a FROM clause to the column's table, fixes [ticket:111]
doc updates for column defaults, indexes, connection pooling, engine params
unit tests for the above bugfixes
2006-03-13 00:24:54 +00:00
Mike Bayer 2ce45d70c7 added expire() function + unit test fixes [ticket:95] 2006-03-10 05:03:17 +00:00
Mike Bayer 3f620ec490 overhaul to types system, decoupled base type and engine-specific type into a composed pattern instead of goofy inheritance....gets rid of TypeDecorator (now a no-op) and enables all inhertance 2006-03-09 18:30:27 +00:00
Mike Bayer b5060e88ff added 'noninherited table' prop to mapper indicating the "lead" table, in the case of
inheritance.  relations now create priamry/secondary joins against that lead table.  if you want to create it against
an inherited table, use explicit join conditions.
added 'correlate' argument to CompoundSelect to get polymorph example working again.
2006-03-09 00:24:15 +00:00
Mike Bayer 376f4af318 added check to relation that will see if the same table is included between the primaryjoin and secondaryjoin, and raises a descriptive exception if so. 2006-03-08 21:39:53 +00:00
Mike Bayer 06b8c73ad5 serious overhaul to get eager loads to work inline with an inheriting mapper, when the inheritance/eager loads share the same table. mapper inheritance will also favor the columns from the child table over those of the parent table when assigning column values to object attributes. "correlated subqueries" require a flag "correlated=True" if they are in the FROM clause of another SELECT statement, and they want to be correlated. this flag is set by default when using an "exists" clause. 2006-03-08 20:51:51 +00:00
Mike Bayer 32aa76601d fixed bug in eager loading on a many-to-one [ticket:96], added the ticket tests as a unit test eagerload2.
got eagerload1 to be a unit test also.
2006-03-06 19:06:06 +00:00
Mike Bayer d54b5eba74 added unittest for orm-persisted insert without a postfetch, tweak to engine to only signal postfetch if the passivedefault columns received None/NULL for their parameter (since they dont exec otherwise) 2006-03-05 21:10:20 +00:00
Mike Bayer 9446e490cb got mapper to receive the onupdates after updating an instance (also properly receives defaults on inserts)... 2006-03-05 21:01:21 +00:00
Mike Bayer 9c4f3c0480 got column onupdate working
improvement to Function so that they can more easily be called standalone without having to throw them into a select().
2006-03-05 20:31:44 +00:00
Mike Bayer c1d0c2dffc got column defaults to be executeable 2006-03-04 20:23:37 +00:00
Mike Bayer 3cacdfcc31 moved name to 'defaults', going to put more default stuff in 2006-03-04 19:29:05 +00:00
Mike Bayer 7c0ff2178b making sequences, column defaults independently executeable 2006-03-04 19:26:23 +00:00
Mike Bayer 7ad8cc9420 removed the dependency of ANSICompiler on SQLEngine. you can now make ANSICompilers and compile SQL with no engine at all. 2006-03-04 18:53:35 +00:00
Mike Bayer 13710ae742 added util.Logger object with configurable thread/timestamp view 2006-03-03 00:24:41 +00:00
Mike Bayer 413dcdf0f4 engine argument on tables optional
test suite uses BaseProxyEngine as a base for the tester engine
documented global proxy engine
2006-03-02 00:38:16 +00:00
Mike Bayer fd8d4a45ea made SchemaEngine more prominent as the base of Table association
BaseProxyEngine descends from SchemaEngine
fixes to sqlite/postgres reflection to use the correct engine for table lookups
Table engine can be none which will default to schema.default_engine (although its
still positional for now, so still needs to be explicit to make room for Columns)
__init__ sets default_engine to be a blank ProxyEngine
fixes to test suite to allow --db proxy.<dbname> to really test proxyengine
2006-03-01 21:20:59 +00:00
Mike Bayer e8d8fa14b6 added schema support for postgres column defaults, fix for [ticket:88] 2006-03-01 07:22:53 +00:00
Mike Bayer 7e4d55686c added convert_unicode flag to engine + unittest, does unicode in/out translation on all string/char values when set 2006-03-01 00:08:01 +00:00
Mike Bayer a4ba9b5414 oid inits at compilation time/when needed again, added a unit test 2006-02-28 23:18:43 +00:00
Mike Bayer 7c1bb1f7a2 added items() method to RowProxy + unittest, courtesy dialtone@divmod.com 2006-02-28 22:50:43 +00:00
jeff 84a43c5cf9 Added code to make foreignkey on ActiveMapper accept a string and create the ForeignKey object on the fly. Also added ability to pass args and kwargs to Column constructor. ActiveMapper columns can have keyword args indexed and unique which will automatically create a index or a unique index. dburi in AutoConnectEngine can be a callable. 2006-02-27 15:36:48 +00:00
Mike Bayer e5415ee9e1 more work on cycles, fleshed out tests for post_update, fix to the delete phase of a one-to-many post update
closes [ticket:67]
2006-02-27 01:05:01 +00:00
Jason Pellerin 271da5b885 Merge indexes [1047]:[1048] into trunk (for #6) 2006-02-26 22:57:46 +00:00
Mike Bayer 6aae45aeaa implemented SyncRules for mapper with inheritance relationship, fixes [ticket:81]
TableFinder becomes a list-implementing object (should probably create clauseutils or sqlutils for these little helper visitors)
2006-02-26 22:23:01 +00:00
Mike Bayer ae6a00ddf4 factored out "syncrule" logic to a separate package, so mapper will be able to make use of it as well as properties. also clarifies the "synchronization" idea 2006-02-26 21:45:10 +00:00
Mike Bayer 1750e5ad75 added test to illustrate wacky inhertitance/many-to-many thing 2006-02-26 06:17:21 +00:00
Mike Bayer 0e436bdbee adjustment to compile synchronizers which allows many-to-many synchronize to work even when one side of the relation has both tables in it (new unittest will be added to inheritance.py to show this...) 2006-02-26 06:14:12 +00:00
Mike Bayer 770ec1ce7a fixed ticket 72, where a copied clause was using the identical bind param object thereby screwing up a generated statement that included both the original clause and the copied clause, when positional parameters were used 2006-02-26 02:25:42 +00:00
Mike Bayer 4b08fe4dd4 clauseelement.compile() totally works without an engine 2006-02-25 07:22:01 +00:00
Mike Bayer 72dd2b08be merged sql_rearrangement branch , refactors sql package to work standalone with
clause elements including tables and columns, schema package deals with "physical"
representations
2006-02-25 07:12:50 +00:00
Mike Bayer c789153144 test commit 2006-02-22 08:13:25 +00:00
Mike Bayer a080db03e8 one more test commit 2006-02-22 07:47:58 +00:00
Mike Bayer c47cda5593 this is a test commit 2006-02-22 06:40:14 +00:00
Mike Bayer bdcc6e92ae more fix to one-to-one: 'unchanged_items' can be [None] also with one to one so check for this
during delete
2006-02-22 06:29:05 +00:00
Mike Bayer 24e22e2e5a fix to EagerLoad where it late-initializes its eager chain, thereby not getting messed up by late add_property() calls 2006-02-22 00:28:59 +00:00
Mike Bayer a2ff73200c working on postupdate idea, refactoring to dependency processing 2006-02-21 02:57:38 +00:00
Mike Bayer bec1b4f92e merged eager loading overhaul rev 1001:1009
this includes:
sql.Alias object keeps track of the immediate thing it aliased as well
as the ultimate non-aliased (usually a Table) object, so that proxied columns can have
a "parent" attribute
some cleanup to SelectBaseMixin.order_by_clause to allow easier access, needs more cleanup
engine has been making two ResultProxies all this time, added "return_raw" quickie flag to
disable that
some cleanup to _get_col_by_original so that it also works for oid columns, new eager load stuff
more aggressively aliaseses orderby's so this was needed
EagerLoader now makes "chains" of unique aliased eager loaders in all cases.  no need for
use_alias/selectalias anymore since it aliases every time.
properly detects recursive eager loads and terminates them with a lazyloader, instead of
raising an exception.  totally simplified setup() and init() is more straightforward and has
a single codepath now instead of two or three.
2006-02-20 19:45:08 +00:00
Mike Bayer 36383494b5 some comments, changed SmartProperty to be smarter, UOW
version has "property" accessor which returns MapperProperty at
the class level
2006-02-19 01:25:56 +00:00
Mike Bayer f1a68f37fa exception package added, support throughout 2006-02-19 00:19:16 +00:00
Mike Bayer 2d5e6eb93b onetoone 2006-02-19 00:18:38 +00:00
Mike Bayer 18d23f22dc converted to a unittest 2006-02-19 00:18:00 +00:00
Mike Bayer 6ade673cfc test only for postgres 2006-02-19 00:17:27 +00:00
Mike Bayer d345840321 beginning of a row cycle test 2006-02-18 23:44:37 +00:00