diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-12-10 16:24:21 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-12-10 16:24:21 +0000 |
| commit | 7cc6b26d31769c15ad972ebf204f6bf52d5175cf (patch) | |
| tree | ad4f72a483c3b9ee917bcacbe7b832f2a7bed19b | |
| parent | 2d777e16074c365db64f62cbca150e7fbd46df71 (diff) | |
| parent | d692b11608f540e4d4df8f4127ee52a476e0e5e4 (diff) | |
| download | sqlalchemy-7cc6b26d31769c15ad972ebf204f6bf52d5175cf.tar.gz | |
Merge "Add ``scalars`` to Migration - ORM Usage table." into main
| -rw-r--r-- | doc/build/changelog/migration_20.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/build/changelog/migration_20.rst b/doc/build/changelog/migration_20.rst index 5fdd093d0..2ec9bc858 100644 --- a/doc/build/changelog/migration_20.rst +++ b/doc/build/changelog/migration_20.rst @@ -1289,9 +1289,12 @@ following the table, and may include additional notes not summarized here. session.execute( select(User) ).scalars().all() + # or + session.scalars(select(User)).all() - :ref:`migration_20_unify_select` + :meth:`_orm.Session.scalars` :meth:`_engine.Result.scalars` * - :: @@ -1318,11 +1321,11 @@ following the table, and may include additional notes not summarized here. - :: - session.execute( + session.scalars( select(User). filter_by(name="some user"). limit(1) - ).scalars().first() + ).first() - :ref:`migration_20_unify_select` @@ -1336,7 +1339,7 @@ following the table, and may include additional notes not summarized here. - :: - session.execute( + session.scalars( select(User). options( joinedload(User.addresses) @@ -1372,12 +1375,12 @@ following the table, and may include additional notes not summarized here. - :: - session.execute( + session.scalars( select(User). from_statement( text("select * from users") ) - ).scalars().all() + ).all() - :ref:`orm_queryguide_selecting_text` |
