Commit Graph

7 Commits

Author SHA1 Message Date
Mike Bayer 0c8c7b6656 improve cross-linking between Core /ORM for schema arg
this should be backported to 1.3 as well to as much a degree
as possible.

Includes a new recipe to set the default schema name
on connect.   this will only work on 1.4, but also requires
that we fix #5708 for it to work fully.

Change-Id: I882edd5bbe06ee5b4d0a9c148854a57b2bcd4741
2020-11-30 19:07:36 -05:00
Mike Bayer 7082e4c447 Clarify how ORM rows are returned in the tutorial
The ORM querying guide discussed how rows are returned but
the tutorial fails to introduce this important concept.

Fixes: #5706
Change-Id: I8c9585e28841b5dd86f4ab642f57cbc763635425
2020-11-17 09:58:56 -05:00
Federico Caselli f18316a14f Some small improvements on the tutorial 2.0 documents
Change-Id: I7fb37d45c29307b2213bebd0ef280d73804ac473
2020-11-13 23:03:01 +01:00
Mike Bayer 5b674ac631 Allow multiple returning() calls
Multiple calls to "returning", e.g. :meth:`_sql.Insert.returning`,
may now be chained to add new columns to the RETURNING clause.

Fixes: #5695
Change-Id: Ie2dac4162f686c730e000e31dccfb38f9ce9c96e
2020-11-11 11:57:59 -05:00
Mike Bayer 1f7969ae50 Warn / raise for returning() / return_defaults() combinations
A warning is emmitted if a returning() method such as
:meth:`_sql.Insert.returning` is called multiple times, as this does not
yet support additive operation.  Version 1.4 will support additive
operation for this.  Additionally, any combination of the
:meth:`_sql.Insert.returning` and :meth:`_sql.Insert.return_defaults`
methods now raises an error as these methods are mutually exclusive;
previously the operation would fail silently.

Fixes: #5691
Change-Id: Id95e0f9da48bba0b59439cb26564f0daa684c8e3
2020-11-11 11:36:06 -05:00
Mike Bayer afb26d79d7 Remove misleading correlation examples
add links to tutorial docs

Fixes: #5694
Change-Id: I10a8e3f46a115945ded36d4ee59165c056c10f7a
2020-11-11 10:42:09 -05:00
Mike Bayer 654b462d66 tutorial 2.0 WIP
Add SelectBase.exists() method as it seems strange this is
not available already.  The Exists construct itself does
not provide full SELECT-building capabilities so it makes
sense this should be used more like a scalar_subquery.

Make sure stream_results is getting set up when yield_per
is used, for 2.0 style statements as well.  this was
hardcoded inside of Query.yield_per() and is now moved
to take place within QueryContext.

Change-Id: Icafcd4fd9b708772343d56edf40995c9e8f835d6
2020-10-31 13:44:53 -04:00