Commit Graph

25 Commits

Author SHA1 Message Date
Mike Bayer 042184fdc9 add a checkfirst here as s3 seems to be stuck on the jenkins db 2012-03-14 16:25:57 -07:00
Mike Bayer c718ad227e tests for FK/autoincrement selection 2011-12-06 22:00:35 -05:00
Mike Bayer 9ae8de1f65 - Fixed bug where "autoincrement" detection on
Table would fail if the type had no "affinity"
value, in particular this would occur when using
the UUID example on the site that uses TypeEngine
as the "impl".
2011-06-30 18:48:01 -04:00
Mike Bayer 1dcf33e712 fix some tests 2011-06-02 03:09:08 -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 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
Taavi Burns 82ea447819 Tests for unicode columns with non-unicode defaults. See #2079. 2011-03-14 14:42:11 -04: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 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 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 350aed3fdb - whitespace removal bonanza 2011-01-02 14:23:42 -05:00
Mike Bayer e1402efb19 - move sqlalchemy.test to test.lib 2010-11-15 19:37:50 -05:00
Mike Bayer 9911443b9d - new oursql dialect added. [ticket:1613] 2009-11-10 22:39:42 +00:00
Mike Bayer e35dcee6ca - The "start" and "increment" attributes on Sequence now
generate "START WITH" and "INCREMENT BY" by default,
on Oracle and Postgresql.  Firebird doesn't support
these keywords right now.  [ticket:1545]
2009-11-03 18:33:57 +00:00
Mike Bayer c5571ab19a - an executemany() now requires that all bound parameter
sets require that all keys are present which are
present in the first bound parameter set.  The structure
and behavior of an insert/update statement is very much
determined by the first parameter set, including which
defaults are going to fire off, and a minimum of
guesswork is performed with all the rest so that performance
is not impacted.  For this reason defaults would otherwise
silently "fail" for missing parameters, so this is now guarded
against. [ticket:1566]
2009-10-15 18:41:02 +00:00
Mike Bayer 9bab004a9b - unit test fixes
- py3k readme
- removed column.sequence accessor
2009-10-10 16:14:13 +00:00
Philip Jenvey 5a9c1b8824 merge from branches/clauseelement-nonzero
adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash
collisions (which only occur on Jython)
fixes #1547
2009-09-24 02:11:56 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00