]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Convert remaining ORM APIs to support 2.0 style
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 8 Jul 2020 18:31:17 +0000 (14:31 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Jul 2020 18:55:51 +0000 (14:55 -0400)
commit5de0f1cf50cc0170d8ea61304e7b887259ab577b
treed351743b4ce2009584ef494ab33a6c3f81ab6bb4
parente2d4b2e72cb97bc5612fa9d1ec7d0ab15d38efe1
Convert remaining ORM APIs to support 2.0 style

This is kind of a mixed bag of all kinds to help get us
to 1.4 betas.    The documentation stuff is a work in
progress.    Lots of other relatively small changes to
APIs and things.    More commits will follow to continue
improving the documentation and transitioning to the
1.4/2.0 hybrid documentation.  In particular some refinements
to Session usage models so that it can match Engine's
scoping / transactional patterns, and a decision to
start moving away from "subtransactions" completely.

* add select().from_statement() to produce FromStatement in an
  ORM context

* begin referring to select() that has "plugins" for the few edge
  cases where select() will have ORM-only behaviors

* convert dynamic.AppenderQuery to its own object that can use
  select(), though at the moment it uses Query to support legacy
  join calling forms.

* custom query classes for AppenderQuery are replaced by
  do_orm_execute() hooks for custom actions, a separate gerrit
  will document this

* add Session.get() to replace query.get()

* Deprecate session.begin->subtransaction.  propose within the
  test suite a hypothetical recipe for apps that rely on this
  pattern

* introduce Session construction level context manager,
  sessionmaker context manager, rewrite the whole top of the
  session_transaction.rst documentation.   Establish context manager
  patterns for Session that are identical to engine

* ensure same begin_nested() / commit() behavior as engine

* devise all new "join into an external transaction" recipe,
  add test support for it, add rules into Session so it
  just works, write new docs.  need to ensure this doesn't
  break anything

* vastly reduce the verbosity of lots of session docs as
  I dont think people read this stuff and it's difficult
  to keep current in any case

* constructs like case(), with_only_columns() really need
  to move to *columns, add a coercion rule to just change
  these.

* docs need changes everywhere I look.  in_() is not in
  the Core tutorial?  how do people even know about it?
  Remove tons of cruft from Select docs, etc.

* build a system for common ORM options like populate_existing
  and autoflush to populate from execution options.

* others?

Change-Id: Ia4bea0f804250e54d90b3884cf8aab8b66b82ecf
45 files changed:
doc/build/changelog/migration_20.rst
doc/build/core/future.rst
doc/build/core/selectable.rst
doc/build/core/tutorial.rst
doc/build/glossary.rst
doc/build/index.rst
doc/build/orm/collections.rst
doc/build/orm/persistence_techniques.rst
doc/build/orm/session.rst
doc/build/orm/session_basics.rst
doc/build/orm/session_transaction.rst
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/ext/baked.py
lib/sqlalchemy/orm/__init__.py
lib/sqlalchemy/orm/context.py
lib/sqlalchemy/orm/dynamic.py
lib/sqlalchemy/orm/loading.py
lib/sqlalchemy/orm/persistence.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/session.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/operators.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/testing/assertions.py
test/aaa_profiling/test_memusage.py
test/orm/inheritance/test_basic.py
test/orm/test_deprecations.py
test/orm/test_dynamic.py
test/orm/test_froms.py
test/orm/test_options.py
test/orm/test_query.py
test/orm/test_relationships.py
test/orm/test_session.py
test/orm/test_transaction.py
test/orm/test_unitofwork.py
test/sql/test_case_statement.py
test/sql/test_compare.py
test/sql/test_compiler.py
test/sql/test_deprecations.py
test/sql/test_selectable.py