Commit Graph

6083 Commits

Author SHA1 Message Date
Mike Bayer 34f26ee255 - Fixed bug where a column with a SQL or server side default
that was excluded from a mapping with include_properties
or exclude_properties would result in UnmappedColumnError.
[ticket:1995]
2011-02-09 15:14:54 -05:00
Mike Bayer 6f16b8db6f - add connection and cursor to is_disconnect(). We aren't using it yet,
but we'd like to.   Most DBAPIs don't give us anything we can do with it.
Some research was done on psycopg2 and it still seems like they give us
no adequate method (tried connection.closed, cursor.closed, connection.status).
mxodbc claims their .closed attribute will work (but I am skeptical).
- remove beahvior in pool that auto-invalidated a connection when
the cursor failed to create.  That's not the pool's job.  we need the conn
for the error logic.  Can't get any tests to fail, curious why that
behavior was there, guess we'll find out (or not).
- add support for psycopg2 version detection.  even though we have
no use for it yet...
- adjust one of the reconnect tests to work with oracle's
horrendously slow connect speed
2011-02-09 15:06:32 -05:00
Mike Bayer f473398f01 - Added an additional libpq message to the list of "disconnect"
exceptions, "could not receive data from server"
[ticket:2044]
2011-02-09 10:58:16 -05:00
Mike Bayer 8f381f202e - Adjusted flush accounting step to occur before
the commit in the case of autocommit=True.  This allows
autocommit=True to work appropriately with
expire_on_commit=True, and also allows post-flush session
hooks to operate in the same transactional context
as when autocommit=False.  [ticket:2041]
2011-02-07 16:12:24 -05:00
Mike Bayer ae5b58d9a5 - Session constructor emits a warning when autoflush=True
or expire_on_commit=True when autocommit=True.
[ticket:2041]
2011-02-07 13:30:27 -05:00
Mike Bayer f14f71581c show sequence members 2011-02-05 16:51:24 -05:00
Mike Bayer cf428767dd typo 2011-02-05 16:50:52 -05:00
Mike Bayer a43b106aa7 - Session weak_instance_dict=False is deprecated.
[ticket:1473]
2011-02-05 16:48:17 -05:00
Mike Bayer 5baeabb0c4 - use proper directive here 2011-02-05 16:10:14 -05:00
Mike Bayer 85084caeff - A single contains_eager() call across
multiple entities will indicate all collections
along that path should load, instead of requiring
distinct contains_eager() calls for each endpoint
(which was never correctly documented).
[ticket:2032]

- The "name" field used in orm.aliased() now renders
in the resulting SQL statement.
2011-02-05 16:09:49 -05:00
Mike Bayer 637fdd3251 - apply optimizations to alternate row proxies, [ticket:1787]
- add check to fetchmany() for None, don't send argument if not present,
helps DBAPIs which don't accept "None" for default (ie. pysqlite, maybe others)
- add tests to test_execute to provide 100% coverage for the three alternate
result proxy classes
2011-02-04 18:33:49 -05:00
Mike Bayer d5cc2f83c1 - When explicit sequence execution derives the name
of the auto-generated sequence of a SERIAL column,
which currently only occurs if implicit_returning=False,
now accommodates if the table + column name is greater
than 63 characters using the same logic Postgresql uses.
[ticket:1083]
2011-02-04 17:37:36 -05:00
Mike Bayer 4f1274fc1f - Also emits the correct WHERE criterion
when using single table inheritance. [ticket:2038]
2011-02-02 19:03:20 -05:00
Mike Bayer c5b4938a9a - Fixed bug where "middle" class in a polymorphic hierarchy
would have no 'polymorphic_on' column if it didn't also
specify a 'polymorphic_identity', leading to strange
errors upon refresh, wrong class loaded when querying
from that target. [ticket:2038]
2011-02-02 18:10:07 -05:00
Mike Bayer 5a2c332f5e - Some adjustments so that Interbase is supported as well.
FB/Interbase version idents are parsed into a structure
such as (8, 1, 1, 'interbase') or (2, 1, 588, 'firebird')
so they can be distinguished. [ticket:1885]
- fixed relfection of the "autoincrement" flag against a default
placed on the column.
2011-02-01 16:34:37 -05:00
Mike Bayer 7fcbd39118 docuemnt args for before_parent_attach, after_parent_attach 2011-02-01 15:09:28 -05:00
Mike Bayer 54cc2aa18c - schema.copy() functions will copy dispatch, but only for those events
added with propagate=True.   needs tests
- oracle/fb test schema uses event w/ propagate=True to apply
Sequence to primary key columns with test_needs_autoincrement.
this does actually test the propagate=True flag a bit since it's
needed in the declarative mixin tests where the 'id' column
is copied.
2011-02-01 09:26:36 -05:00
Mike Bayer 12073e281e - SchemaItem, SchemaType now descend from common type
SchemaEventTarget, which supplies dispatch
- the dispatch now provides before_parent_attach(),
after_parent_attach(), events which generally bound the _set_parent()
event. [ticket:2037]
- the _on_table_attach mechanism now usually uses the
event dispatch
- fixed class-level event dispatch to propagate to all subclasses, not just
immediate subclasses
- fixed class-level event unpickling to handle more involved
inheritance hierarchies, needed by the new schema event dispatch.
- ForeignKeyConstraint doesn't re-call the column attach event
on ForeignKey objects that are already associated with the correct
Column
- we still need that ImportError on mysqldb CLIENT FLAGS to support
mock DBAPIs
2011-01-30 20:29:48 -05:00
Mike Bayer 41d222b5f8 - Added some defs to the resultproxy.c extension so that
the extension compiles and runs on Python 2.4.
    [ticket:2023]
2011-01-30 15:08:41 -05:00
Mike Bayer 7ad7dde6a5 - A warning is emitted when a joined-table inheriting mapper
has no primary keys on the locally mapped table
    (but has pks on the superclass table).  [ticket:2019]
2011-01-30 14:18:01 -05:00
Mike Bayer c05a8988bb yikes, change that name on the Alias class too 2011-01-30 14:12:03 -05:00
Mike Bayer 7ac30f96b9 - Added a name argument to Query.subquery(), to allow
a fixed name to be assigned to the alias object.
[ticket:2030]
- changed the kw name 'alias' to 'name' on the alias() standalone
function.
- fixed up some alias/join docstrings
2011-01-30 13:39:08 -05:00
Mike Bayer 1c1ff92fa9 - Column.copy(), as used in table.tometadata(), copies the
'doc' attribute.  [ticket:2028]
2011-01-30 13:09:45 -05:00
Mike Bayer d7b0e194db fix this to work on 2.4 2011-01-26 11:50:00 -05:00
Mike Bayer 1515073b96 - New DBAPI support for pymysql, a pure Python port
of MySQL-python.  [ticket:1991]
2011-01-26 11:18:03 -05:00
Mike Bayer 9122268ed0 - new dialect for Drizzle [ticket:2003]
- move mysqldb to a connector, can be shared among mysql/drizzle
2011-01-26 10:44:00 -05:00
Mike Bayer 3ac7ec476e - fix oracle tests
- fix some obnoxious type adaption issues resulting from the "adapt must copy" change
2011-01-25 22:37:18 -05:00
Mike Bayer 86e6c2bafb callcount 2011-01-25 14:08:58 -05:00
Mike Bayer 3be8746527 add example usage for shard_id in context feature [ticket:2031] 2011-01-23 17:08:57 -05:00
Mike Bayer de725a0a4d - Horizontal shard query places 'shard_id' in
context.attributes where it's accessible by the
"load()" event. [ticket:2031]
2011-01-23 17:03:19 -05:00
Mike Bayer e6855d3f77 fix some formatting here 2011-01-21 17:16:47 -05:00
Mike Bayer ee174e5acf and try that again..... 2011-01-20 15:36:40 -05:00
Mike Bayer 79619c70e0 - use types.MethodType here for python3 compat 2011-01-20 14:25:15 -05:00
Mike Bayer eee9b55f0c rename 'frozendict' to 'immutabledict', since 'frozen' implies hashability
like frozenset which isn't really the purpose of 'immutabledict' (could be someday,
in which case, we'd change the name back :) )
2011-01-20 13:32:59 -05:00
Mike Bayer 07440265c4 typos 2011-01-18 17:23:15 -05:00
Mike Bayer 4a357af1ae - Session.connection(), Session.execute() accept 'bind',
to allow execute/connection operations to participate
in the open transaction of an engine explicitly.
[ticket:1996]
- fix up the docs for connection, execute, which were awful.
- correct usage strings in hybrid
2011-01-18 17:13:36 -05:00
Mike Bayer b3dd50a8da - Session.merge() will check the version id of the incoming
state against that of the database, assuming the mapping
uses version ids and incoming state has a version_id
assigned, and raise StaleDataError if they don't
match.  [ticket:2027]
2011-01-18 16:34:34 -05:00
Mike Bayer 0f52225ba8 - move maxdb notes from wiki to the maxdb module
- move exception docs down to the lower portion of core/orm
2011-01-18 16:02:02 -05:00
Mike Bayer dc7d611182 - tests for hybrid
- documentation for hybrid
- rewrite descriptor, synonym, comparable_property documentation
2011-01-17 20:05:09 -05:00
Mike Bayer cbaa4c9d5d - remove old perf/ tests from pre-2007 2011-01-16 20:24:05 -05:00
Mike Bayer a9a6766790 - the zblog example is obsolete, the tests don't really test it
and a key feature of its mapping (the deferred col outside of the select)
doesn't work anyway.
- add a token "deferred on selectable" test to test_mapper.
2011-01-16 20:18:32 -05:00
Mike Bayer 7325ba60bc - execution_options() on Connection accepts
"isolation_level" argument, sets transaction isolation
level for that connection only until returned to the
connection pool, for thsoe backends which support it
(SQLite, Postgresql) [ticket:2001]
- disallow the option on Engine (use isolation_level to create_engine()),
Executable (we don't want to check/set per statement)
- docs
2011-01-16 17:04:07 -05:00
Mike Bayer 8259e2fd2b - default_isolation_level is equal to isolation_level since it's
detected after the initial setting
2011-01-16 13:19:14 -05:00
Mike Bayer a233638268 - add dialect.reset_isolation_level(), reverts
- base not implemented methods on Dialect
2011-01-16 13:15:26 -05:00
Mike Bayer aa62a3a833 - factor consistent set_isolation_level(), get_isolation_level()
per-connection methods for sqlite, postgresql, psycopg2 dialects
- move isolation test suite to test engines/test_transaction
- preparing for [ticket:2001]
2011-01-16 13:05:18 -05:00
Mike Bayer 8ca1e58032 - oracle fixes 2011-01-15 19:50:01 -05:00
Mike Bayer aedd34f34f Regarding reflection for this case, reflection of an int PK col
with a server_default sets the "autoincrement" flag to False,
except in the case of a PG SERIAL col where we detected a
sequence default. [ticket:2020] [ticket:2021]
2011-01-15 16:50:52 -05:00
Mike Bayer dff5a404e4 - getting slightly more consistent behavior for the edge case of pk columns
with server default - autoincrement is now false with any server_default,
so these all return None, applies consistency to [ticket:2020], [ticket:2021].
if prefetch is desired a "default" should be used instead of server_default.
2011-01-15 16:42:29 -05:00
Mike Bayer fc0ffac241 stupid workaround for pg8000 2011-01-15 13:49:39 -05:00
Mike Bayer 39c79c039c - allow aliased() to call .alias() on a selectable, [ticket:2018] 2011-01-15 13:48:58 -05:00