8 Commits

Author SHA1 Message Date
Mike Bayer 83b2e9e8d2 - Fixed bug in INSERT..FROM SELECT construct where selecting from a
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes #3044
2014-05-25 14:10:34 -04:00
Mike Bayer 506817a84e - Fixed bug where calling :meth:.Insert.values with an empty list
or tuple would raise an IndexError.   It now produces an empty
insert construct as would be the case with an empty dictionary.

Conflicts:
	lib/sqlalchemy/sql/dml.py
2014-02-19 15:23:04 -05:00
Mike Bayer 2042493228 - Fixed bug with :meth:.Insert.from_select method where the order
of the given names would not be taken into account when generating
the INSERT statement, thus producing a mismatch versus the column
names in the given SELECT statement.  Also noted that
:meth:`.Insert.from_select` implies that Python-side insert defaults
cannot be used, since the statement has no VALUES clause. [ticket:2895]
2013-12-19 16:05:15 -05:00
Mike Bayer 8373d7599e - Added new method to the :func:.insert construct
:meth:`.Insert.from_select`.  Given a list of columns and
a selectable, renders ``INSERT INTO (table) (columns) SELECT ..``.
While this feature is highlighted as part of 0.9 it is also
backported to 0.8.3. [ticket:722]
- The :func:`.update`, :func:`.insert`, and :func:`.delete` constructs
will now interpret ORM entities as FROM clauses to be operated upon,
in the same way that select() already does.
2013-07-05 15:52:34 -04:00
Mike Bayer 6bdd3bb93f - reinstate insert returning back into test_insert.py; defaultdialect
needs to be explicit here since tablestest sticks testing.db onto metadata.bind
2013-04-01 15:41:57 -04:00
Diana Clarke 25c6732019 moving insert returning test back into CRUD test class until I figure out why moving it broke the oracle/postgres builds 2013-03-30 09:30:58 -04:00
Diana Clarke e6d6cfbf6b fixing tests for --db=mysql: VARCHAR requires a length on dialect mysql 2013-03-30 01:01:59 -04:00
Diana Clarke 17487a0db7 move the insert tests from CRUDTest into sql/test_insert.py (see #2630) 2013-03-29 19:10:01 -04:00