summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2023-04-21 15:00:47 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2023-04-21 15:05:47 -0400
commit553dcbc11cf9401b85bc2aab55977eb1925cf262 (patch)
tree7d7a154947ce2a0e30752fa379abd4b64a235686
parent69ba6e3cf771dce93b18350ab6b4a4ab79604b40 (diff)
downloadsqlalchemy-553dcbc11cf9401b85bc2aab55977eb1925cf262.tar.gz
changelog fixes; edits
Change-Id: I6bbef2416f864d1414d56f9bf39026156aed5e67
-rw-r--r--doc/build/changelog/unreleased_20/9608.rst5
-rw-r--r--doc/build/changelog/unreleased_20/9613.rst4
-rw-r--r--doc/build/changelog/unreleased_20/9628.rst8
-rw-r--r--doc/build/core/connections.rst2
-rw-r--r--doc/build/orm/queryguide/dml.rst2
-rw-r--r--lib/sqlalchemy/dialects/postgresql/asyncpg.py8
-rw-r--r--lib/sqlalchemy/dialects/postgresql/ranges.py6
7 files changed, 19 insertions, 16 deletions
diff --git a/doc/build/changelog/unreleased_20/9608.rst b/doc/build/changelog/unreleased_20/9608.rst
index a1b06cbe3..3646ac7e6 100644
--- a/doc/build/changelog/unreleased_20/9608.rst
+++ b/doc/build/changelog/unreleased_20/9608.rst
@@ -3,10 +3,9 @@
:tickets: 9608
Added ``prepared_statement_name_func`` connection argument option in the
- asyncpg dialect. This option allow passing a callable used to customize
+ asyncpg dialect. This option allows passing a callable used to customize
the name of the prepared statement that will be created by the driver
- when executing the queries.
- Pull request curtesy of Pavel Sirotkin.
+ when executing queries. Pull request courtesy Pavel Sirotkin.
.. seealso::
diff --git a/doc/build/changelog/unreleased_20/9613.rst b/doc/build/changelog/unreleased_20/9613.rst
index 1c44eb1ec..3534bea1d 100644
--- a/doc/build/changelog/unreleased_20/9613.rst
+++ b/doc/build/changelog/unreleased_20/9613.rst
@@ -1,6 +1,6 @@
.. change::
- :tags: usecase, pool
- :tickets: 9625
+ :tags: usecase, engine
+ :tickets: 9613
Added :func:`_sa.create_pool_from_url` and
:func:`_asyncio.create_async_pool_from_url` to create
diff --git a/doc/build/changelog/unreleased_20/9628.rst b/doc/build/changelog/unreleased_20/9628.rst
index 0d9368349..df39e8e15 100644
--- a/doc/build/changelog/unreleased_20/9628.rst
+++ b/doc/build/changelog/unreleased_20/9628.rst
@@ -3,11 +3,11 @@
:tickets: 9628
Fixed bug in ORM Declarative Dataclasses where the
- :func:`_orm.queryable_attribute` and :func:`_orm.column_property`
+ :func:`_orm.query_expression` and :func:`_orm.column_property`
constructs, which are documented as read-only constructs in the context of
a Declarative mapping, could not be used with a
:class:`_orm.MappedAsDataclass` class without adding ``init=False``, which
- in the case of :func:`_orm.queryable_attribute` was not possible as no
+ in the case of :func:`_orm.query_expression` was not possible as no
``init`` parameter was included. These constructs have been modified from a
dataclass perspective to be assumed to be "read only", setting
``init=False`` by default and no longer including them in the pep-681
@@ -16,8 +16,8 @@
these fields don't apply to :func:`_orm.column_property` as used in a
Declarative dataclasses configuration where the construct would be
read-only. Also added read-specific parameter
- :paramref:`_orm.queryable_attribute.compare` to
- :func:`_orm.queryable_attribute`; :paramref:`_orm.queryable_attribute.repr`
+ :paramref:`_orm.query_expression.compare` to
+ :func:`_orm.query_expression`; :paramref:`_orm.query_expression.repr`
was already present.
diff --git a/doc/build/core/connections.rst b/doc/build/core/connections.rst
index f0d74f6d1..488c2dfad 100644
--- a/doc/build/core/connections.rst
+++ b/doc/build/core/connections.rst
@@ -1812,7 +1812,7 @@ and more support towards in recent release series.
Current Support
~~~~~~~~~~~~~~~
-The feature is enabled for all included SQLAlchemy backends that support
+The feature is enabled for all backend included in SQLAlchemy that support
RETURNING, with the exception of Oracle for which both the cx_Oracle and
OracleDB drivers offer their own equivalent feature. The feature normally takes
place when making use of the :meth:`_dml.Insert.returning` method of an
diff --git a/doc/build/orm/queryguide/dml.rst b/doc/build/orm/queryguide/dml.rst
index b836e6984..04a4fb2bb 100644
--- a/doc/build/orm/queryguide/dml.rst
+++ b/doc/build/orm/queryguide/dml.rst
@@ -162,7 +162,7 @@ Correlating RETURNING records with input data order
When using bulk INSERT with RETURNING, it's important to note that most
database backends provide no formal guarantee of the order in which the
-records from RETURNING are sent, including that there is no guarantee that
+records from RETURNING are returned, including that there is no guarantee that
their order will correspond to that of the input records. For applications
that need to ensure RETURNING records can be correlated with input data,
the additional parameter :paramref:`_dml.Insert.returning.sort_by_parameter_order`
diff --git a/lib/sqlalchemy/dialects/postgresql/asyncpg.py b/lib/sqlalchemy/dialects/postgresql/asyncpg.py
index 0c7f17ce9..c879205e4 100644
--- a/lib/sqlalchemy/dialects/postgresql/asyncpg.py
+++ b/lib/sqlalchemy/dialects/postgresql/asyncpg.py
@@ -108,7 +108,7 @@ can lead to errors if a name has already been taken for another prepared
statement. This issue can arise if your application uses database proxies
such as PgBouncer to handle connections. One possible workaround is to
use dynamic prepared statement names, which asyncpg now supports through
-an optional name value for the statement name. This allows you to
+an optional ``name`` value for the statement name. This allows you to
generate your own unique names that won't conflict with existing ones.
To achieve this, you can provide a function that will be called every time
a prepared statement is prepared::
@@ -130,9 +130,9 @@ a prepared statement is prepared::
https://github.com/sqlalchemy/sqlalchemy/issues/6467
.. warning:: To prevent a buildup of useless prepared statements in
- your application, it's important to use the NullPool poolclass and
- PgBouncer with a configured `DISCARD https://www.postgresql.org/docs/current/sql-discard.html`_
- setup. The DISCARD command is used to release resources held by the db connection,
+ your application, it's important to use the :class:`.NullPool` pool
+ class, and to configure PgBouncer to use `DISCARD <https://www.postgresql.org/docs/current/sql-discard.html>`_
+ when returning connections. The DISCARD command is used to release resources held by the db connection,
including prepared statements. Without proper setup, prepared statements can
accumulate quickly and cause performance issues.
diff --git a/lib/sqlalchemy/dialects/postgresql/ranges.py b/lib/sqlalchemy/dialects/postgresql/ranges.py
index cefd280ea..20006e7ab 100644
--- a/lib/sqlalchemy/dialects/postgresql/ranges.py
+++ b/lib/sqlalchemy/dialects/postgresql/ranges.py
@@ -642,7 +642,11 @@ class Range(Generic[_T]):
return self.difference(other)
def intersection(self, other: Range[_T]) -> Range[_T]:
- """Compute the intersection of this range with the `other`."""
+ """Compute the intersection of this range with the `other`.
+
+ .. versionadded:: 2.0.10
+
+ """
if self.empty or other.empty or not self.overlaps(other):
return Range(None, None, empty=True)