Commit Graph

31 Commits

Author SHA1 Message Date
Mike Bayer 89ff6df7dc - pep8 2014-08-20 19:12:32 -04:00
Mike Bayer bb5f4392a4 - update the flake8 rules again
- apply autopep8 + manual fixes to most of test/sql/
2014-07-18 17:40:58 -04:00
Mike Bayer 2f150bee28 - rename __multiple__ to __backend__, and apply __backend__ to a large number of tests.
- move out logging tests from test_execute to test_logging
2014-03-24 11:33:53 -04:00
Mike Bayer 835f1a38bf repair missing oracle skip 2013-08-28 10:16:52 -04:00
Mike Bayer 5672f78806 callcounts 2013-08-27 23:51:34 -04:00
Mike Bayer 7bf231232c - cx_oracle seems to have a bug here though it is hard to track down
- cx_oracle dialect doesn't use normal col names, lets just not rely on that for now
2013-08-27 21:37:22 -04:00
Mike Bayer e9c748a7bf - ensure rowcount is returned for an UPDATE with no implicit returning
- modernize test for that
- use py3k compatible next() in test_returning/test_versioning
2013-08-25 17:37:59 -04:00
Mike Bayer d6ce68727f - The `version_id_generator parameter of Mapper` can now be specified
to rely upon server generated version identifiers, using triggers
or other database-provided versioning features, by passing the value
``False``.  The ORM will use RETURNING when available to immediately
load the new version identifier, else it will emit a second SELECT.
[ticket:2793]
- The ``eager_defaults`` flag of :class:`.Mapper` will now allow the
newly generated default values to be fetched using an inline
RETURNING clause, rather than a second SELECT statement, for backends
that support RETURNING.
- Added a new variant to :meth:`.ValuesBase.returning` called
:meth:`.ValuesBase.return_defaults`; this allows arbitrary columns
to be added to the RETURNING clause of the statement without interfering
with the compilers usual "implicit returning" feature, which is used to
efficiently fetch newly generated primary key values.  For supporting
backends, a dictionary of all fetched values is present at
:attr:`.ResultProxy.returned_defaults`.
- add a glossary entry for RETURNING
- add documentation for version id generation, [ticket:867]
2013-08-25 14:03:54 -04:00
Mike Bayer 8ef3ed1032 - this test is ridiculous, executemany() + returning not supported 2013-03-09 14:42:34 -05:00
Mike Bayer 8070cbde71 internally at least refer to multirow as "multivalues", to distinguish between
an INSERT that's used in executemany() as opposed to one which has a VALUES
clause with multiple entries.
2012-12-08 16:17:20 -05:00
Mike Bayer 927b985983 - multivalued inserts, [ticket:2623]
- update "not supported" messages for empty inserts, mutlivalue inserts

- rework the ValuesBase approach for multiple value sets so that stmt.parameters
does store a list for multiple values; the _has_multiple_parameters flag now indicates
which of the two modes the statement is within.  it now raises exceptions if a subsequent
call to values() attempts to call a ValuesBase with one mode in the style of the other
mode; that is, you can't switch a single- or multi- valued ValuesBase to the other mode,
and also if a multiple value is passed simultaneously with a kwargs set.
Added tests for these error conditions

- Calling values() multiple times in multivalue mode now extends the parameter list to
include the new parameter sets.

- add error/test if multiple *args were passed to ValuesBase.values()

- rework the compiler approach for multivalue inserts, back to where
_get_colparams() returns the same list of (column, value) as before, thereby
maintaining the identical number of append() and other calls when multivalue
is not enabled.  In the case of multivalue, it makes a last-minute switch to return
a list of lists instead of the single list.  As it constructs the additional lists, the inline
defaults and other calculated default parameters of the first parameter
set are copied into the newly generated lists so that these features continue
to function for a multivalue insert.   Multivalue inserts now add no additional
function calls to the compilation for regular insert constructs.

- parameter lists for multivalue inserts now includes an integer index for all
parameter sets.

- add detailed documentation for ValuesBase.values(), including careful wording
to describe the difference between multiple values and an executemany() call.

- add a test for multivalue insert + returning - it works !

- remove the very old/never used "postgresql_returning"/"firebird_returning" flags.
2012-12-08 14:25:42 -05:00
Mike Bayer ef7c2f359d - don't call get_lastrowid() on explicit returning
- don't hardwire "subqueries" requirement in the base, mysql < 4.1 isn't working anyway
- don't need explicit FB/PG exclusions in test_returning
- hit db.connect() for the returning requirement
2012-10-04 17:36:02 -04:00
Mike Bayer 20cdc64588 trying different approaches to test layout. in this one, the testing modules
become an externally usable package but still remains within the main sqlalchemy parent package.
in this system, we use kind of an ugly hack to get the noseplugin imported outside of the
"sqlalchemy" package, while still making it available within sqlalchemy for usage by
third party libraries.
2012-09-27 02:37:33 -04:00
Mike Bayer e4ff3d2a35 oracle fixes... 2012-08-25 14:19:47 -04:00
Mike Bayer a2468c8a31 - [feature] To complement [ticket:2547], types
can now provide "bind expressions" and
"column expressions" which allow compile-time
injection of SQL expressions into statements
on a per-column or per-bind level.   This is
to suit the use case of a type which needs
to augment bind- and result- behavior at the
SQL level, as opposed to in the Python level.
Allows for schemes like transparent encryption/
decryption, usage of Postgis functions, etc.
[ticket:1534]
- update postgis example fully.
- still need to repair the result map propagation
here to be transparent for cases like "labeled column".
2012-08-17 18:35:25 -04:00
Mike Bayer 27913554a8 trailing whitespace bonanza 2012-07-28 15:50:05 -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 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 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
Philip Jenvey 09dc52c03d tweak to take advantage of returning support in executemany 2010-03-12 19:01:59 -08:00
Mike Bayer b763015642 re-enable these tests 2010-03-11 21:34:13 +00:00
Mike Bayer ee8eea4101 these fail for unknown reasons. Seems to be potentially VARCHAR used with RETURNING, or out params, not sure. 2010-03-11 18:39:15 +00:00
Mike Bayer cd6af2e03b working on pyodbc / mxodbc 2010-02-27 20:03:33 +00:00
Mike Bayer e552ce339e - RETURNING is supported by 8.2+
- add docs for PG delete..returning
2009-10-21 16:33:04 +00:00
Philip Jenvey f385260987 mssql+zxjdbc support
original patch from Victor Ng
fixes #1505
2009-09-11 08:10:32 +00:00
Philip Jenvey 8e551942c0 this workaround isn't necessary 2009-08-18 05:51:32 +00:00
Philip Jenvey fc59a5e0c4 oracle+zxjdbc returning support 2009-08-18 05:28:05 +00:00
Philip Jenvey a53d4e2ab4 o oracle+zxjdbc type handling additions
o avoid returning tests on oracle+zxjdbc for now
2009-08-09 00:56:52 +00:00
Mike Bayer a7499ddfc0 fix up oracle tests, returning is on by default 2009-08-08 16:49:28 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00