Commit Graph

660 Commits

Author SHA1 Message Date
Mike Bayer 3452a2ba03 - Fixed bug whereby if FetchedValue was passed
to column server_onupdate, it would not
have its parent "column" assigned, added
test coverage for all column default assignment
patterns.  [ticket:2147]  also in 0.6.8
2011-04-23 12:34:17 -04:00
Mike Bayer 0c560edee7 - Added explicit check for when Column .name
is assigned as blank string [ticket:2140]
2011-04-20 15:49:33 -04:00
Mike Bayer 566f468877 - move documentation of available execution options to Connection - this is the main
place these should be used
- Executable disallows "compiled_cache" option for now which was previously being ignored
[ticket:2131]
- Query now passes execution options to the Connection rather than the statement
so that all options are allowed including compiled cache.
2011-04-17 16:10:59 -04:00
Mike Bayer 69dcd805d2 - Added explicit true()/false() constructs to expression
lib - coercion rules will intercept "False"/"True"
into these constructs.  In 0.6, the constructs were
typically converted straight to string, which was
no longer accepted in 0.7.  [ticket:2117]
2011-04-17 15:37:12 -04:00
Mike Bayer ae363b0663 - Before/after attach events for PrimaryKeyConstraint
now function, tests added for before/after events
on all constraint types.  [ticket:2105]
2011-04-17 13:53:21 -04:00
Mike Bayer 509f3fb492 - Fixed incorrect usage of "," in over() clause
being placed between the "partition" and "order by"
clauses.  [ticket:2134]
2011-04-17 13:40:37 -04:00
Mike Bayer 2d34ded2d8 - fixed bug where "from" clause gathering from an
over() clause would be an itertools.chain() and
    not a list, causing "can only concatenate list"
    TypeError when combined with other clauses.
2011-04-14 23:44:03 -04:00
Mike Bayer f9113b5dbf - Fixed support for precision numerics when using
pg8000. [ticket:2132]
2011-04-14 13:54:47 -04:00
Mike Bayer df3bf65f12 - more liberal check here
- dont encode enums in py3k
2011-04-08 15:16:12 -04:00
Mike Bayer 51fea2e159 - The limit/offset keywords to select() as well
as the value passed to select.limit()/offset()
will be coerced to integer.  [ticket:2116]
(also in 0.6.7)
- Oracle dialect adds use_binds_for_limits=False
create_engine() flag, will render the LIMIT/OFFSET
values inline instead of as binds, reported to
modify the execution plan used by Oracle.
[ticket:2116] (Also in 0.6.7)
2011-04-07 13:34:38 -04:00
Mike Bayer b462373b46 - REAL has been added to the core types. Supported
by Postgresql, SQL Server, MySQL, SQLite.  Note
that the SQL Server and MySQL versions, which
add extra arguments, are also still available
from those dialects.  [ticket:2081]
2011-04-05 12:40:55 -04:00
Mike Bayer d34bc7da31 - The 'useexisting' flag on Table has been superceded
by a new pair of flags 'keep_existing' and
'extend_existing'.   'extend_existing' is equivalent
to 'useexisting' - the existing Table is returned,
and additional constructor elements are added.
With 'keep_existing', the existing Table is returned,
but additional constructor elements are not added -
these elements are only applied when the Table
is newly created.   [ticket:2109]
2011-04-05 12:04:42 -04:00
Mike Bayer 7b24e458c7 - move all the comments that got shoved below the fixture grabs back up 2011-03-27 17:19:00 -04:00
Mike Bayer 68a350d462 - remove test.sql._base, test.engine._base, test.orm._base, move those classes to a new test.lib.fixtures module
- move testing.TestBase to test.lib.fixtures
- massive search and replace
2011-03-27 16:27:27 -04:00
Mike Bayer ebd0fdad73 - convert @provide_metadata to use self access
- having occasional issues with BasicEntity grabbing, if it persists
may have to pass an explicit base class into setup_classes()/setup_mappers()
2011-03-26 21:40:05 -04:00
Mike Bayer 14a2fae239 - remove @testing.resolve_artifact_names, replace with direct attribute
access to the cls/self.tables/classes registries
- express orm/_base.py ORMTest in terms of engine/_base.py TablesTest,
factor out common steps into TablesTest, remove AltEngineTest as a
separate class.   will further consolidate these base classes
2011-03-26 19:03:11 -04:00
Mike Bayer de529fb81c - adjust the previous checkin a bit. need to transfer sequences over from pickle
even if they are *not* restated.  its necessary here to do a "replacement"
scheme when an incoming sequence replaces the previous.  Theoretically
we could do what Table does here, i.e. use a singleton constructor, but
this is heavyhanded.   The most recent sequence placed in is the winner
is likely the most expected behavior.
2011-03-23 17:38:54 -04:00
Mike Bayer 93da3087f1 - Fixed regression whereby MetaData() coming
back from unpickling did not keep track of
new things it keeps track of now, i.e.
collection of Sequence objects, list
of schema names.  [ticket:2104]
2011-03-23 17:25:57 -04:00
Mike Bayer 39c465ecf3 - Restored the "catchall" constructor on the base
TypeEngine class, with a deprecation warning.
This so that code which does something like
Integer(11) still succeeds.
2011-03-21 11:49:43 -04:00
Mike Bayer 90335a89a9 - Added new generic function "next_value()", accepts
a Sequence object as its argument and renders the
appropriate "next value" generation string on the
target platform, if supported.  Also provides
".next_value()" method on Sequence itself.
[ticket:2085]
- added tests for all the conditions described
in [ticket:2085]
- postgresql dialect will exec/compile a Sequence
that has "optional=True".  the optional flag is now only
checked specifically in the context of a Table primary key
evaulation.
- func.next_value() or other SQL expression can
be embedded directly into an insert() construct,
and if implicit or explicit "returning" is used
in conjunction with a primary key column,
the newly generated value will be present in
result.inserted_primary_key. [ticket:2084]
2011-03-20 12:49:28 -04:00
Mike Bayer 92c8979d4a - Firebird - the "implicit_returning" flag on create_engine() is
honored if set to False.  [ticket:2083]
2011-03-16 11:22:28 -04:00
Mike Bayer e93ca97bae - Added accessors to ResultProxy "returns_rows", "is_insert"
[ticket:2089]
2011-03-16 10:36:48 -04:00
Taavi Burns f9e58cad3b Fix 3 errors in py32, from patch from lsblakk. There are still 8 failures. See #2088. 2011-03-16 00:32:33 -04:00
Denise Govindarajan 2e3ce3d737 Merge 2011-03-15 17:55:01 -04:00
Denise Govindarajan d33e0a597d psycopg2 2.4 no longer accepts % in bind place holders 2011-03-15 17:47:36 -04:00
Jim Phares fde2a7f8fe Informix and postgresql reserved words changes -- almost done. 2011-03-15 16:56:45 -04:00
Taavi Burns 82ea447819 Tests for unicode columns with non-unicode defaults. See #2079. 2011-03-14 14:42:11 -04:00
Mike Bayer cf51131150 - Added a fully descriptive error message for the
case where Column is subclassed and _make_proxy()
fails to make a copy due to TypeError on the
constructor.   The method _constructor should
be implemented in this case.
2011-02-28 12:47:04 -05:00
Mike Bayer a7f766d7c7 - establish an "insert" option for events to control ordering if needed (not needed yet tho)
- render foreign key constraints in the order in which they were cerated
2011-02-25 13:20:43 -05:00
Mike Bayer 01cb94690d - The Column.references() method now returns True
if it has a foreign key referencing the
given column exactly, not just it's parent
table.  [ticket:2064]
2011-02-17 20:27:35 -05:00
Mike Bayer 2e4da52221 - The Sequence() construct, when passed a MetaData()
object via its 'metadata' argument, will be
included in CREATE/DROP statements within
metadata.create_all() and metadata.drop_all(),
including "checkfirst" logic.  [ticket:2055]
2011-02-13 19:32:00 -05:00
Mike Bayer 33eae4a140 make it more explicit in tests which dialect we want to use for things 2011-02-11 11:24:54 -05:00
Mike Bayer 09efc11fbc - need to limit the list of oracle fn's that don't get parens to a
fixed list.  window functions need parens
2011-02-11 00:49:28 -05:00
Mike Bayer 3cbab1ee1e fix some really egregious long lines 2011-02-10 22:09:26 -05:00
Mike Bayer 020d6ef8f0 - Added over() function, method to FunctionElement
classes, produces the _Over() construct which
in turn generates "window functions", i.e.
"<window function> OVER (PARTITION BY <partition by>,
ORDER BY <order by>)".
[ticket:1844]
2011-02-10 21:57:44 -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 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 1c1ff92fa9 - Column.copy(), as used in table.tometadata(), copies the
'doc' attribute.  [ticket:2028]
2011-01-30 13:09:45 -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 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 0f31f36fe5 - dont count server_default absense as part of autoincrement, PG
will have a value here upon reflection.
- mysql, others will have to check "server_default" when rendering
special keywords like AUTOINCREMENT
2011-01-12 15:49:59 -05:00
Mike Bayer 67e0f356b2 - A TypeDecorator of Integer can be used with a primary key
column, and the "autoincrement" feature of various dialects
  as well as the "sqlite_autoincrement" flag will honor
  the underlying database type as being Integer-based.
 [ticket:2005]

- Result-row processors are applied to pre-executed SQL
  defaults, as well as cursor.lastrowid, when determining
  the contents of result.inserted_primary_key.
  [ticket:2006]

- Bind parameters present in the "columns clause" of a select
  are now auto-labeled like other "anonymous" clauses,
  which among other things allows their "type" to be meaningful
  when the row is fetched, as in result row processors.

- TypeDecorator is present in the "sqlalchemy" import space.
2011-01-11 15:22:46 -05:00
Mike Bayer 4e9e0f041c - merge r43460573c27a:4993c7eae8e5d117ff342bdc59f3b0635b898e2c of 0.6 branch 2011-01-08 16:14:47 -05:00
Mike Bayer e46301b515 - The Index() construct can be created inline with a Table
definition, using strings as column names, as an alternative
to the creation of the index outside of the Table.
2011-01-04 13:48:46 -05:00
Mike Bayer 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Michael Trier c0ddbf502f Ridding the world of a few wasteful imports. 2010-12-19 23:16:50 -05:00
Michael Trier 650bbcc8fd merge tip 2010-12-19 19:38:03 -05:00