Commit Graph

6094 Commits

Author SHA1 Message Date
Mike Bayer ad8700a556 - oursql dialect accepts the same "ssl" arguments in
create_engine() as that of MySQLdb.  [ticket:2047]
2011-02-10 18:04:54 -05:00
Mike Bayer f367117562 - typo fix [ticket:2017] 2011-02-10 15:24:26 -05:00
Mike Bayer bc52cae455 - mssql VARBINARY emits 'max' for length when no length specified, as is
the case already for VARCHAR, NVARCHAR [ticket:1833]
2011-02-10 15:22:07 -05:00
Mike Bayer e43f85965e - The path given as the location of a sqlite database is now
normalized via os.path.abspath(), so that directory changes
within the process don't affect the ultimate location
of a relative file path.  [ticket:2036]
2011-02-10 15:03:11 -05:00
Mike Bayer 3f9a343d72 - Query.distinct() now accepts column expressions
as *args, interpreted by the Postgresql dialect
  as DISTINCT ON (<expr>). [ticket:1069]
- select.distinct() now accepts column expressions
  as *args, interpreted by the Postgresql dialect
  as DISTINCT ON (<expr>).  Note this was already
  available via passing a list to the `distinct`
  keyword argument to select(). [ticket:1069]
- select.prefix_with() accepts multiple expressions
  (i.e. *expr), 'prefix' keyword argument to select()
  accepts a list or tuple.
- Passing a string to the `distinct` keyword argument
  of `select()` for the purpose of emitting special
  MySQL keywords (DISTINCTROW etc.) is deprecated -
  use `prefix_with()` for this.
- put kw arguments to select() in order
- restore docs for _SelectBase, renamed from _SelectBaseMixin
2011-02-10 14:17:08 -05:00
Mike Bayer a6d54d18c1 formatting fix 2011-02-10 11:43:04 -05:00
Mike Bayer e155b7b864 - An exception is raised in the unusual case that an
append or similar event on a collection occurs after
the parent object has been dereferenced, which
prevents the parent from being marked as "dirty"
in the session.  Will commit as a warning in 0.6.
[ticket:2046]
2011-02-10 11:30:23 -05:00
Mike Bayer 311fa4f876 - py3k fix regarding new exception system
- this test keeps throwing a TNS error on Oracle on the buildbot only, runs locally,
seems to be related to some scaling/memory type of issue on the bot
2011-02-09 19:18:33 -05:00
Mike Bayer 7e8f351097 - Non-DBAPI errors which occur in the scope of an execute()
call are now wrapped in sqlalchemy.exc.StatementError,
and the text of the SQL statement and repr() of params
is included.  This makes it easier to identify statement
executions which fail before the DBAPI becomes
involved.  [ticket:2015]
2011-02-09 18:11:40 -05:00
Mike Bayer e80eac22a8 - figured out the ::autodata directive, can move the docstring for
expression.func into the .py module
- added a note about logging only being checked on new connections,
as one user had this issue awhile back, and I suspect it for
a current ML user issue
2011-02-09 16:30:49 -05:00
Mike Bayer 3f30fb065c - The compiler extension now supports overriding the default
compilation of expression._BindParamClause including that
the auto-generated binds within the VALUES/SET clause
of an insert()/update() statement will also use the new
compilation rules. [ticket:2042]
2011-02-09 15:45:15 -05:00
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