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)).
Mike Bayer [Mon, 11 Sep 2006 00:20:28 +0000 (00:20 +0000)]
- implemented "version check" logic in Query/Mapper, used
when version_id_col is in effect and query.with_lockmode()
is used to get() an instance thats already loaded
[ticket:292]
Mike Bayer [Sun, 10 Sep 2006 23:52:04 +0000 (23:52 +0000)]
- changed "for_update" parameter to accept False/True/"nowait"
and "read", the latter two of which are interpreted only by
Oracle and Mysql [ticket:292]
- added "lockmode" argument to base Query select/get functions,
including "with_lockmode" function to get a Query copy that has
a default locking mode. Will translate "read"/"update"
arguments into a for_update argument on the select side.
[ticket:292]
Mike Bayer [Thu, 7 Sep 2006 20:04:10 +0000 (20:04 +0000)]
- more rearrangements of unit-of-work commit scheme to better allow
dependencies within circular flushes to work properly...updated
task traversal/logging implementation
this work is still under construction ! requires more unit tests and
new dumper needs to be finished.
Mike Bayer [Tue, 5 Sep 2006 16:58:02 +0000 (16:58 +0000)]
restored "optimistic" behavior of hasparent. its generally disastrous without that flag as its impossible to load all lazy loaders, deal with attributes that "noload", etc. just to check for orphan status.
Mike Bayer [Sat, 2 Sep 2006 04:00:44 +0000 (04:00 +0000)]
- further changes to attributes with regards to "trackparent". the "commit" operation
now sets a "hasparent" flag for all attributes to all objects. that way lazy loads
via callables get included in trackparent, and eager loads do as well because the mapper
calls commit() on all objects at load time. this is a less shaky method than the "optimistic"
thing in the previous commit, but uses more memory and involves more overhead.
- some tweaks/cleanup to unit tests
Mike Bayer [Fri, 1 Sep 2006 17:01:55 +0000 (17:01 +0000)]
futher fix to the "orphan state" idea. to avoid setting tons of
"hasparent" flags on objects as they are loaded, both from lazy and eager loads,
the "orphan" check now uses an "optimistic" flag to determine the result if no
"hasparent" flag is found for a particular relationship on an instance. if the
instance has an _instance_key and therefore was loaded from the database, it is
assumed to not be an orphan unless a "False" hasparent flag has been set. if the
instance does not have an _instance_key and is therefore transient/pending, it is
assumed to be an orphan unless a "True" hasparent flag has been set.
Mike Bayer [Thu, 31 Aug 2006 18:58:22 +0000 (18:58 +0000)]
- added case_sensitive argument to MetaData, Table, Column, determines
itself automatically based on if a parent schemaitem has a non-None
setting for the flag, or if not, then whether the identifier name is all lower
case or not. when set to True, quoting is applied to identifiers with mixed or
uppercase identifiers. quoting is also applied automatically in all cases to
identifiers that are known to be reserved words or contain other non-standard
characters. various database dialects can override all of this behavior, but
currently they are all using the default behavior. tested with postgres, mysql,
sqlite. needs more testing with firebird, oracle, ms-sql. part of the ongoing
work with [ticket:155]
Mike Bayer [Sat, 26 Aug 2006 21:32:11 +0000 (21:32 +0000)]
- changed "invalidate" semantics with pooled connection; will
instruct the underlying connection record to reconnect the next
time its called. "invalidate" will also automatically be called
if any error is thrown in the underlying call to connection.cursor().
this will hopefully allow the connection pool to reconnect to a
database that had been stopped and started without restarting
the connecting application [ticket:121]
Mike Bayer [Sat, 26 Aug 2006 19:46:33 +0000 (19:46 +0000)]
- added "timezone=True" flag to DateTime and Time types. postgres
so far will convert this to "TIME[STAMP] (WITH|WITHOUT) TIME ZONE",
so that control over timezone presence is more controllable (psycopg2
returns datetimes with tzinfo's if available, which can create confusion
against datetimes that dont).
[ticket:275]
Mike Bayer [Fri, 25 Aug 2006 16:27:10 +0000 (16:27 +0000)]
- cleanup on connection methods + documentation. custom DBAPI
arguments specified in query string, 'connect_args' argument
to 'create_engine', or custom creation function via 'creator'
function to 'create_engine'.
- added "recycle" argument to Pool, is "pool_recycle" on create_engine,
defaults to 3600 seconds; connections after this age will be closed and
replaced with a new one, to handle db's that automatically close
stale connections [ticket:274]
Mike Bayer [Mon, 21 Aug 2006 00:37:34 +0000 (00:37 +0000)]
- postgres reflection moved to use pg_schema tables, can be overridden
with use_information_schema=True argument to create_engine
[ticket:60], [ticket:71]
- added natural_case argument to Table, Column, semi-experimental
flag for use with table reflection to help with quoting rules
[ticket:155]
Mike Bayer [Fri, 18 Aug 2006 20:12:39 +0000 (20:12 +0000)]
[ticket:280] statement execution supports using the same BindParam
object more than once in an expression; simplified handling of positional
parameters. nice job by Bill Noon figuring out the basic idea.
Mike Bayer [Fri, 18 Aug 2006 17:21:01 +0000 (17:21 +0000)]
- unit-of-work does a better check for "orphaned" objects that are
part of a "delete-orphan" cascade, for certain conditions where the
parent isnt available to cascade from.
- it is now invalid to declare a self-referential relationship with
"delete-orphan" (as the abovementioned check would make them impossible
to save)
- improved the check for objects being part of a session when the
unit of work seeks to flush() them as part of a relationship..
Mike Bayer [Thu, 17 Aug 2006 18:04:13 +0000 (18:04 +0000)]
commit should be outside of the try/except; else when commit fails, rollback gets called which is technically invalid (although SA transaction probably lets it slide...this should also possibly be made more strict)
Mike Bayer [Thu, 17 Aug 2006 00:12:59 +0000 (00:12 +0000)]
if a contextual session is established via MapperExtension.get_session
(as it is using the sessioncontext plugin, etc), a lazy load operation
will use that session by default if the parent object is not
persistent with a session already.
Mike Bayer [Tue, 15 Aug 2006 02:02:47 +0000 (02:02 +0000)]
- eesh ! the tutorial doctest was broken for quite some time.
- add_property() method on mapper does a "compile all mappers"
step in case the given property references a non-compiled mapper
(as it did in the case of the tutorial !)
Mike Bayer [Sat, 12 Aug 2006 22:58:49 +0000 (22:58 +0000)]
modifcation to unitofwork to not maintain ordering within the
"new" list or within the UOWTask "objects" list; instead, new objects
are tagged with an ordering identifier as they are registered as new
with the session, and the INSERT statements are then sorted within the
mapper save_obj. the INSERT ordering has basically been pushed allthe way
to the end of the flush cycle. that way the various sorts and
organizations occuring within UOWTask (particularly the circular task
sort) dont have to worry about maintaining order (which they werent anyway)
Mike Bayer [Sat, 12 Aug 2006 17:53:04 +0000 (17:53 +0000)]
turned off default case-folding rules as they wreak havoc with the current unittests,
temporary isintance() checks in ASNIIdentifierPreparer which will be replaced with visit_
methodology
Mike Bayer [Sat, 12 Aug 2006 17:28:15 +0000 (17:28 +0000)]
quoting facilities set up so that database-specific quoting can be
turned on for individual table, schema, and column identifiers when
used in all queries/creates/drops. Enabled via "quote=True" in
Table or Column, as well as "quote_schema=True" in Table. Thanks to
Aaron Spike for his excellent efforts. [ticket:155]