summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2022-10-13 09:12:04 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2022-10-13 09:12:04 -0400
commitcfd5b3e78fdd58174ba8f107412851938524ca1c (patch)
tree061595f5243293188fa639d0c96db72dcd515e7e
parent08880fc5bb6467bce684dfbe7995b3f3b32aee57 (diff)
downloadsqlalchemy-cfd5b3e78fdd58174ba8f107412851938524ca1c.tar.gz
fixes for doc builds
* requirements needs typing_extensions * update all "future=True" references to be appropriate to 2.0 Change-Id: I2eeb0ae65afdb587f21aeb0020f1d8a292f67c21
-rw-r--r--doc/build/conf.py2
-rw-r--r--doc/build/core/operators.rst2
-rw-r--r--doc/build/faq/ormconfiguration.rst2
-rw-r--r--doc/build/orm/session_events.rst4
-rw-r--r--doc/build/orm/session_transaction.rst21
-rw-r--r--doc/build/requirements.txt1
-rw-r--r--doc/build/tutorial/dbapi_transactions.rst2
-rw-r--r--doc/build/tutorial/engine.rst7
-rw-r--r--examples/extending_query/filter_public.py2
-rw-r--r--examples/extending_query/temporal_range.py2
-rw-r--r--examples/sharding/separate_databases.py1
-rw-r--r--examples/sharding/separate_schema_translates.py1
-rw-r--r--examples/sharding/separate_tables.py1
13 files changed, 20 insertions, 28 deletions
diff --git a/doc/build/conf.py b/doc/build/conf.py
index 7abdd45e2..7d1a4d445 100644
--- a/doc/build/conf.py
+++ b/doc/build/conf.py
@@ -109,7 +109,7 @@ changelog_render_pullreq = {
changelog_render_changeset = "https://www.sqlalchemy.org/trac/changeset/%s"
-exclude_patterns = ["build", "**/unreleased*/*", "**/*_include.rst"]
+exclude_patterns = ["build", "**/unreleased*/*", "**/*_include.rst", ".venv"]
autodoc_class_signature = "separated"
diff --git a/doc/build/core/operators.rst b/doc/build/core/operators.rst
index dde977c9e..9bf47ec66 100644
--- a/doc/build/core/operators.rst
+++ b/doc/build/core/operators.rst
@@ -5,7 +5,7 @@ Operator Reference
>>> from sqlalchemy import column, select
>>> from sqlalchemy import create_engine
- >>> engine = create_engine("sqlite+pysqlite:///:memory:", echo=True, future=True)
+ >>> engine = create_engine("sqlite+pysqlite:///:memory:", echo=True)
>>> from sqlalchemy import MetaData, Table, Column, Integer, String, Numeric
>>> metadata_obj = MetaData()
>>> user_table = Table(
diff --git a/doc/build/faq/ormconfiguration.rst b/doc/build/faq/ormconfiguration.rst
index d3c9dba85..3ff3c93b8 100644
--- a/doc/build/faq/ormconfiguration.rst
+++ b/doc/build/faq/ormconfiguration.rst
@@ -347,4 +347,4 @@ loads directly to primary key values just loaded.
.. seealso::
- :ref:`subqueryload_ordering`
+ :ref:`subquery_eager_loading`
diff --git a/doc/build/orm/session_events.rst b/doc/build/orm/session_events.rst
index b502191e5..980e301d1 100644
--- a/doc/build/orm/session_events.rst
+++ b/doc/build/orm/session_events.rst
@@ -45,7 +45,7 @@ interception of a query, which includes those emitted by
provides accessors to allow modifications to statements, parameters, and
options::
- Session = sessionmaker(engine, future=True)
+ Session = sessionmaker(engine)
@event.listens_for(Session, "do_orm_execute")
@@ -84,7 +84,7 @@ may be used on its own, or is ideally suited to be used within the
from sqlalchemy.orm import with_loader_criteria
- Session = sessionmaker(engine, future=True)
+ Session = sessionmaker(engine)
@event.listens_for(Session, "do_orm_execute")
diff --git a/doc/build/orm/session_transaction.rst b/doc/build/orm/session_transaction.rst
index be4590670..aca558d6f 100644
--- a/doc/build/orm/session_transaction.rst
+++ b/doc/build/orm/session_transaction.rst
@@ -221,21 +221,16 @@ without the need for refreshing it from the database.
Session-level vs. Engine level transaction control
--------------------------------------------------
-As of SQLAlchemy 1.4, the :class:`_orm.sessionmaker` and Core
-:class:`_engine.Engine` objects both support :term:`2.0 style` operation,
-by making use of the :paramref:`_orm.Session.future` flag as well as the
-:paramref:`_engine.create_engine.future` flag so that these two objects
-assume 2.0-style semantics.
-
-When using future mode, there should be equivalent semantics between
-the two packages, at the level of the :class:`_orm.sessionmaker` vs.
+The :class:`_engine.Connection` in Core and
+:class:`_session.Session` in ORM feature equivalent transactional
+semantics, both at the level of the :class:`_orm.sessionmaker` vs.
the :class:`_engine.Engine`, as well as the :class:`_orm.Session` vs.
the :class:`_engine.Connection`. The following sections detail
these scenarios based on the following scheme:
.. sourcecode:: text
- ORM (using future Session) Core (using future engine)
+ ORM Core
----------------------------------------- -----------------------------------
sessionmaker Engine
Session Connection
@@ -297,7 +292,7 @@ that will maintain a begin/commit/rollback context for that object.
Engine::
- engine = create_engine("postgresql+psycopg2://user:pass@host/dbname", future=True)
+ engine = create_engine("postgresql+psycopg2://user:pass@host/dbname")
with engine.begin() as conn:
conn.execute(
@@ -312,7 +307,7 @@ Engine::
Session::
- Session = sessionmaker(engine, future=True)
+ Session = sessionmaker(engine)
with Session.begin() as session:
session.add_all(
@@ -336,7 +331,7 @@ specific behavior that is reversed from the 1.x series.
Engine::
- engine = create_engine("postgresql+psycopg2://user:pass@host/dbname", future=True)
+ engine = create_engine("postgresql+psycopg2://user:pass@host/dbname")
with engine.begin() as conn:
savepoint = conn.begin_nested()
@@ -354,7 +349,7 @@ Engine::
Session::
- Session = sessionmaker(engine, future=True)
+ Session = sessionmaker(engine)
with Session.begin() as session:
savepoint = session.begin_nested()
diff --git a/doc/build/requirements.txt b/doc/build/requirements.txt
index 38511e579..eccea8b18 100644
--- a/doc/build/requirements.txt
+++ b/doc/build/requirements.txt
@@ -3,3 +3,4 @@ git+https://github.com/sqlalchemyorg/sphinx-paramlinks.git#egg=sphinx-paramlinks
git+https://github.com/sqlalchemyorg/zzzeeksphinx.git#egg=zzzeeksphinx
sphinx-copybutton
sphinx-autobuild
+typing-extensions
diff --git a/doc/build/tutorial/dbapi_transactions.rst b/doc/build/tutorial/dbapi_transactions.rst
index 68fc84bcb..00178936b 100644
--- a/doc/build/tutorial/dbapi_transactions.rst
+++ b/doc/build/tutorial/dbapi_transactions.rst
@@ -391,7 +391,7 @@ for many rows while still supporting RETURNING.
.. seealso::
- :term:`executemany` - in the :doc:`Glossary <glossary>`, describes the
+ :term:`executemany` - in the :doc:`Glossary </glossary>`, describes the
DBAPI-level
`cursor.executemany() <https://peps.python.org/pep-0249/#executemany>`_
method that's used for most "executemany" executions.
diff --git a/doc/build/tutorial/engine.rst b/doc/build/tutorial/engine.rst
index e42d67a02..80c20e566 100644
--- a/doc/build/tutorial/engine.rst
+++ b/doc/build/tutorial/engine.rst
@@ -19,14 +19,13 @@ which will describe how it should connect to the database host or backend.
For this tutorial we will use an in-memory-only SQLite database. This is an
easy way to test things without needing to have an actual pre-existing database
-set up. The :class:`_engine.Engine` is created by using :func:`_sa.create_engine`, specifying
-the :paramref:`_sa.create_engine.future` flag set to ``True`` so that we make full use
-of :term:`2.0 style` usage:
+set up. The :class:`_engine.Engine` is created by using the
+:func:`_sa.create_engine` function:
.. sourcecode:: pycon+sql
>>> from sqlalchemy import create_engine
- >>> engine = create_engine("sqlite+pysqlite:///:memory:", echo=True, future=True)
+ >>> engine = create_engine("sqlite+pysqlite:///:memory:", echo=True)
The main argument to :class:`_sa.create_engine`
is a string URL, above passed as the string ``"sqlite+pysqlite:///:memory:"``.
diff --git a/examples/extending_query/filter_public.py b/examples/extending_query/filter_public.py
index 08a0d273d..a420e9da4 100644
--- a/examples/extending_query/filter_public.py
+++ b/examples/extending_query/filter_public.py
@@ -85,7 +85,7 @@ if __name__ == "__main__":
engine = create_engine("sqlite://", echo=True)
Base.metadata.create_all(engine)
- Session = sessionmaker(bind=engine, future=True)
+ Session = sessionmaker(bind=engine)
sess = Session()
diff --git a/examples/extending_query/temporal_range.py b/examples/extending_query/temporal_range.py
index 3a6570ad1..01d0eadf8 100644
--- a/examples/extending_query/temporal_range.py
+++ b/examples/extending_query/temporal_range.py
@@ -50,7 +50,7 @@ if __name__ == "__main__":
engine = create_engine("sqlite://", echo=True)
Base.metadata.create_all(engine)
- Session = sessionmaker(bind=engine, future=True)
+ Session = sessionmaker(bind=engine)
sess = Session()
diff --git a/examples/sharding/separate_databases.py b/examples/sharding/separate_databases.py
index 9818656c3..a45182f42 100644
--- a/examples/sharding/separate_databases.py
+++ b/examples/sharding/separate_databases.py
@@ -31,7 +31,6 @@ db4 = create_engine("sqlite://", echo=echo)
# to databases within a ShardedSession and returns it.
Session = sessionmaker(
class_=ShardedSession,
- future=True,
shards={
"north_america": db1,
"asia": db2,
diff --git a/examples/sharding/separate_schema_translates.py b/examples/sharding/separate_schema_translates.py
index c4f2b9e25..2d4c2a046 100644
--- a/examples/sharding/separate_schema_translates.py
+++ b/examples/sharding/separate_schema_translates.py
@@ -45,7 +45,6 @@ db4 = engine.execution_options(schema_translate_map={None: "schema_4"})
# to databases within a ShardedSession and returns it.
Session = sessionmaker(
class_=ShardedSession,
- future=True,
shards={
"north_america": db1,
"asia": db2,
diff --git a/examples/sharding/separate_tables.py b/examples/sharding/separate_tables.py
index 0f6e2ffd8..8f39471e8 100644
--- a/examples/sharding/separate_tables.py
+++ b/examples/sharding/separate_tables.py
@@ -45,7 +45,6 @@ def before_cursor_execute(
# to databases within a ShardedSession and returns it.
Session = sessionmaker(
class_=ShardedSession,
- future=True,
shards={
"north_america": db1,
"asia": db2,