From 9f9668c801a28c99d78c5e9daca98cbd701e88ee Mon Sep 17 00:00:00 2001 From: "F.D.Castel" Date: Fri, 26 May 2023 16:27:17 -0300 Subject: [PATCH] Documentation fixes (#9747) * Fix typos. * Adjust FAQ entries about SQLite connection pooling in SQLALchemy 2.0. * Rephrase. * Changes suggested by @zzzeek. --- doc/build/faq/connections.rst | 18 +++++++++--------- lib/sqlalchemy/testing/requirements.py | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/doc/build/faq/connections.rst b/doc/build/faq/connections.rst index b0c354c00c..66e878c898 100644 --- a/doc/build/faq/connections.rst +++ b/doc/build/faq/connections.rst @@ -16,8 +16,9 @@ How do I pool database connections? Are my connections pooled? ---------------------------------------------------------------- SQLAlchemy performs application-level connection pooling automatically -in most cases. With the exception of SQLite, a :class:`_engine.Engine` object -refers to a :class:`.QueuePool` as a source of connectivity. +in most cases. For all included dialects (except SQLite when using a +"memory" database), a :class:`_engine.Engine` object refers to a +:class:`.QueuePool` as a source of connectivity. For more detail, see :ref:`engines_toplevel` and :ref:`pooling_toplevel`. @@ -392,13 +393,12 @@ a COMMIT as any connection is returned to the pool:: I am using multiple connections with a SQLite database (typically to test transaction operation), and my test program is not working! ---------------------------------------------------------------------------------------------------------------------------------------------------------- -If using a SQLite ``:memory:`` database, or a version of SQLAlchemy prior -to version 0.7, the default connection pool is the :class:`.SingletonThreadPool`, -which maintains exactly one SQLite connection per thread. So two -connections in use in the same thread will actually be the same SQLite -connection. Make sure you're not using a :memory: database and -use :class:`.NullPool`, which is the default for non-memory databases in -current SQLAlchemy versions. +If using a SQLite ``:memory:`` database the default connection pool is the +:class:`.SingletonThreadPool`, which maintains exactly one SQLite connection +per thread. So two connections in use in the same thread will actually be +the same SQLite connection. Make sure you're not using a :memory: database +so that the engine will use :class:`.QueuePool` (the default for non-memory +databases in current SQLAlchemy versions). .. seealso:: diff --git a/lib/sqlalchemy/testing/requirements.py b/lib/sqlalchemy/testing/requirements.py index 6fb629bf95..45568eac4f 100644 --- a/lib/sqlalchemy/testing/requirements.py +++ b/lib/sqlalchemy/testing/requirements.py @@ -549,7 +549,7 @@ class SuiteRequirements(Requirements): @property def foreign_key_constraint_name_reflection(self): - """Target supports refleciton of FOREIGN KEY constraints and + """Target supports reflection of FOREIGN KEY constraints and will return the name of the constraint that was used in the "CONSTRAINT FOREIGN KEY" DDL. @@ -664,7 +664,7 @@ class SuiteRequirements(Requirements): @property def constraint_comment_reflection(self): - """indicates if the database support constraint on constraints + """indicates if the database support comments on constraints and their reflection""" return exclusions.closed() -- 2.47.3