<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/sqlalchemy.git/test/sql/test_insert.py, branch pr/156</title>
<subtitle>github.com: zzzeek/sqlalchemy.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/'/>
<entry>
<title>- :meth:`.Insert.from_select` now includes Python and SQL-expression</title>
<updated>2014-10-10T21:15:19+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2014-10-10T21:15:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=95be42c06ff4e5f3528de42bb04dcba228ea74c2'/>
<id>95be42c06ff4e5f3528de42bb04dcba228ea74c2</id>
<content type='text'>
defaults if otherwise unspecified; the limitation where non-
server column defaults aren't included in an INSERT FROM
SELECT is now lifted and these expressions are rendered as
constants into the SELECT statement.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
defaults if otherwise unspecified; the limitation where non-
server column defaults aren't included in an INSERT FROM
SELECT is now lifted and these expressions are rendered as
constants into the SELECT statement.
</pre>
</div>
</content>
</entry>
<entry>
<title>- The :func:`~.expression.column` and :func:`~.expression.table`</title>
<updated>2014-09-02T00:19:54+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2014-09-02T00:19:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=7c6a45c480a865ac9580eb33fcca2dae5b19dd11'/>
<id>7c6a45c480a865ac9580eb33fcca2dae5b19dd11</id>
<content type='text'>
constructs are now importable from the "from sqlalchemy" namespace,
just like every other Core construct.
- The implicit conversion of strings to :func:`.text` constructs
when passed to most builder methods of :func:`.select` as
well as :class:`.Query` now emits a warning with just the
plain string sent.   The textual conversion still proceeds normally,
however.  The only method that accepts a string without a warning
are the "label reference" methods like order_by(), group_by();
these functions will now at compile time attempt to resolve a single
string argument to a column or label expression present in the
selectable; if none is located, the expression still renders, but
you get the warning again. The rationale here is that the implicit
conversion from string to text is more unexpected than not these days,
and it is better that the user send more direction to the Core / ORM
when passing a raw string as to what direction should be taken.
Core/ORM tutorials have been updated to go more in depth as to how text
is handled.
fixes #2992
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
constructs are now importable from the "from sqlalchemy" namespace,
just like every other Core construct.
- The implicit conversion of strings to :func:`.text` constructs
when passed to most builder methods of :func:`.select` as
well as :class:`.Query` now emits a warning with just the
plain string sent.   The textual conversion still proceeds normally,
however.  The only method that accepts a string without a warning
are the "label reference" methods like order_by(), group_by();
these functions will now at compile time attempt to resolve a single
string argument to a column or label expression present in the
selectable; if none is located, the expression still renders, but
you get the warning again. The rationale here is that the implicit
conversion from string to text is more unexpected than not these days,
and it is better that the user send more direction to the Core / ORM
when passing a raw string as to what direction should be taken.
Core/ORM tutorials have been updated to go more in depth as to how text
is handled.
fixes #2992
</pre>
</div>
</content>
</entry>
<entry>
<title>- The INSERT...FROM SELECT construct now implies ``inline=True``</title>
<updated>2014-08-21T00:14:20+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2014-08-21T00:14:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=71ca494f518658676b532afaf84a4cc93025dbbb'/>
<id>71ca494f518658676b532afaf84a4cc93025dbbb</id>
<content type='text'>
on :class:`.Insert`.  This helps to fix a bug where an
INSERT...FROM SELECT construct would inadvertently be compiled
as "implicit returning" on supporting backends, which would
cause breakage in the case of an INSERT that inserts zero rows
(as implicit returning expects a row), as well as arbitrary
return data in the case of an INSERT that inserts multiple
rows (e.g. only the first row of many).
A similar change is also applied to an INSERT..VALUES
with multiple parameter sets; implicit RETURNING will no longer emit
for this statement either.  As both of these constructs deal
with varible numbers of rows, the
:attr:`.ResultProxy.inserted_primary_key` accessor does not
apply.   Previously, there was a documentation note that one
may prefer ``inline=True`` with INSERT..FROM SELECT as some databases
don't support returning and therefore can't do "implicit" returning,
but there's no reason an INSERT...FROM SELECT needs implicit returning
in any case.   Regular explicit :meth:`.Insert.returning` should
be used to return variable numbers of result rows if inserted
data is needed.
fixes #3169
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
on :class:`.Insert`.  This helps to fix a bug where an
INSERT...FROM SELECT construct would inadvertently be compiled
as "implicit returning" on supporting backends, which would
cause breakage in the case of an INSERT that inserts zero rows
(as implicit returning expects a row), as well as arbitrary
return data in the case of an INSERT that inserts multiple
rows (e.g. only the first row of many).
A similar change is also applied to an INSERT..VALUES
with multiple parameter sets; implicit RETURNING will no longer emit
for this statement either.  As both of these constructs deal
with varible numbers of rows, the
:attr:`.ResultProxy.inserted_primary_key` accessor does not
apply.   Previously, there was a documentation note that one
may prefer ``inline=True`` with INSERT..FROM SELECT as some databases
don't support returning and therefore can't do "implicit" returning,
but there's no reason an INSERT...FROM SELECT needs implicit returning
in any case.   Regular explicit :meth:`.Insert.returning` should
be used to return variable numbers of result rows if inserted
data is needed.
fixes #3169
</pre>
</div>
</content>
</entry>
<entry>
<title>- update the flake8 rules again</title>
<updated>2014-07-18T21:40:58+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2014-07-18T21:40:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=bb5f4392a4ecbcbaf4e34886a65a8bba42e227d5'/>
<id>bb5f4392a4ecbcbaf4e34886a65a8bba42e227d5</id>
<content type='text'>
- apply autopep8 + manual fixes to most of test/sql/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- apply autopep8 + manual fixes to most of test/sql/
</pre>
</div>
</content>
</entry>
<entry>
<title>- Fixed bug where multi-valued :class:`.Insert` construct would fail</title>
<updated>2014-07-14T22:28:07+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2014-07-14T22:28:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=eb4abda8117263f1e1775460b47076ec70e092d4'/>
<id>eb4abda8117263f1e1775460b47076ec70e092d4</id>
<content type='text'>
to check subsequent values entries beyond the first one given
for literal SQL expressions.
fixes #3069
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
to check subsequent values entries beyond the first one given
for literal SQL expressions.
fixes #3069
</pre>
</div>
</content>
</entry>
<entry>
<title>- Fixed bug in INSERT..FROM SELECT construct where selecting from a</title>
<updated>2014-05-25T18:08:41+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2014-05-25T18:08:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=482a67e1c68d3123ab91f8141ae58c7daa88e6db'/>
<id>482a67e1c68d3123ab91f8141ae58c7daa88e6db</id>
<content type='text'>
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes #3044
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes #3044
</pre>
</div>
</content>
</entry>
<entry>
<title>- Fixed bug where calling :meth:`.Insert.values` with an empty list</title>
<updated>2014-02-19T20:18:22+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2014-02-19T20:18:22+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=77ed03652580c5db925729c573b76ca32393dc67'/>
<id>77ed03652580c5db925729c573b76ca32393dc67</id>
<content type='text'>
or tuple would raise an IndexError.   It now produces an empty
insert construct as would be the case with an empty dictionary.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
or tuple would raise an IndexError.   It now produces an empty
insert construct as would be the case with an empty dictionary.
</pre>
</div>
</content>
</entry>
<entry>
<title>- Fixed bug with :meth:`.Insert.from_select` method where the order</title>
<updated>2013-12-19T21:02:14+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2013-12-19T21:02:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=5f76f29c15b7a23cfe29c5fbd22ad02452b6a2c0'/>
<id>5f76f29c15b7a23cfe29c5fbd22ad02452b6a2c0</id>
<content type='text'>
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]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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]
</pre>
</div>
</content>
</entry>
<entry>
<title>- Added new method to the :func:`.insert` construct</title>
<updated>2013-07-05T19:51:24+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2013-07-05T19:51:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=cec89cae156903c9a77dff29a1213e70fa915b52'/>
<id>cec89cae156903c9a77dff29a1213e70fa915b52</id>
<content type='text'>
: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.  Also in 0.8.3.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
: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.  Also in 0.8.3.
</pre>
</div>
</content>
</entry>
<entry>
<title>- reinstate insert returning back into test_insert.py; defaultdialect</title>
<updated>2013-04-01T19:41:57+00:00</updated>
<author>
<name>Mike Bayer</name>
<email>mike_mp@zzzcomputing.com</email>
</author>
<published>2013-04-01T19:41:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/python-packages/sqlalchemy.git/commit/?id=6bdd3bb93fd18a4aec54ee2a836875a922dcaab3'/>
<id>6bdd3bb93fd18a4aec54ee2a836875a922dcaab3</id>
<content type='text'>
needs to be explicit here since tablestest sticks testing.db onto metadata.bind
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
needs to be explicit here since tablestest sticks testing.db onto metadata.bind
</pre>
</div>
</content>
</entry>
</feed>
