diff options
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 24 | ||||
-rw-r--r-- | lib/sqlalchemy/engine/cursor.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/ext/asyncio/session.py | 4 | ||||
-rw-r--r-- | lib/sqlalchemy/schema.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/schema.py | 15 | ||||
-rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/util/langhelpers.py | 12 |
8 files changed, 39 insertions, 24 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index c923f7014..987e36ed9 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -285,7 +285,7 @@ Remote-Schema Table Introspection and PostgreSQL search_path attribute set up. The PostgreSQL dialect can reflect tables from any schema, as outlined in -:ref:`schema_table_reflection`. +:ref:`metadata_reflection_schemas`. With regards to tables which these :class:`_schema.Table` objects refer to via foreign key constraint, a decision must be made as to how diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 80e458e7c..b2bdd6a8d 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -87,22 +87,22 @@ NO_OPTIONS: Mapping[str, Any] = util.EMPTY_DICT class Connection(ConnectionEventsTarget, inspection.Inspectable["Inspector"]): """Provides high-level functionality for a wrapped DB-API connection. - The :class:`_engine.Connection` object is procured by calling - the :meth:`_engine.Engine.connect` method of the :class:`_engine.Engine` + The :class:`_engine.Connection` object is procured by calling the + :meth:`_engine.Engine.connect` method of the :class:`_engine.Engine` object, and provides services for execution of SQL statements as well as transaction control. - The Connection object is **not** thread-safe. While a Connection can be + The Connection object is **not** thread-safe. While a Connection can be shared among threads using properly synchronized access, it is still possible that the underlying DBAPI connection may not support shared - access between threads. Check the DBAPI documentation for details. + access between threads. Check the DBAPI documentation for details. The Connection object represents a single DBAPI connection checked out - from the connection pool. In this state, the connection pool has no affect - upon the connection, including its expiration or timeout state. For the - connection pool to properly manage connections, connections should be - returned to the connection pool (i.e. ``connection.close()``) whenever the - connection is not in use. + from the connection pool. In this state, the connection pool has no + affect upon the connection, including its expiration or timeout state. + For the connection pool to properly manage connections, connections + should be returned to the connection pool (i.e. ``connection.close()``) + whenever the connection is not in use. .. index:: single: thread safety; Connection @@ -2631,6 +2631,12 @@ class Engine( @property def engine(self) -> Engine: + """Returns this :class:`.Engine`. + + Used for legacy schemes that accept :class:`.Connection` / + :class:`.Engine` objects within the same variable. + + """ return self def clear_compiled_cache(self) -> None: diff --git a/lib/sqlalchemy/engine/cursor.py b/lib/sqlalchemy/engine/cursor.py index d5f0d8126..ec1e1abe1 100644 --- a/lib/sqlalchemy/engine/cursor.py +++ b/lib/sqlalchemy/engine/cursor.py @@ -7,7 +7,7 @@ # mypy: allow-untyped-defs, allow-untyped-calls """Define cursor-specific result set constructs including -:class:`.BaseCursorResult`, :class:`.CursorResult`.""" +:class:`.CursorResult`.""" from __future__ import annotations diff --git a/lib/sqlalchemy/ext/asyncio/session.py b/lib/sqlalchemy/ext/asyncio/session.py index f2a69e9cd..eac2e5806 100644 --- a/lib/sqlalchemy/ext/asyncio/session.py +++ b/lib/sqlalchemy/ext/asyncio/session.py @@ -747,8 +747,8 @@ class AsyncSession(ReversibleProxy[Session]): This method may also be used to establish execution options for the database connection used by the current transaction. - .. versionadded:: 1.4.24 Added **kw arguments which are passed through - to the underlying :meth:`_orm.Session.connection` method. + .. versionadded:: 1.4.24 Added \**kw arguments which are passed + through to the underlying :meth:`_orm.Session.connection` method. .. seealso:: diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py index 86166f9f6..d16bf36b3 100644 --- a/lib/sqlalchemy/schema.py +++ b/lib/sqlalchemy/schema.py @@ -55,10 +55,12 @@ from .sql.schema import DefaultGenerator as DefaultGenerator from .sql.schema import FetchedValue as FetchedValue from .sql.schema import ForeignKey as ForeignKey from .sql.schema import ForeignKeyConstraint as ForeignKeyConstraint +from .sql.schema import HasConditionalDDL as HasConditionalDDL from .sql.schema import Identity as Identity from .sql.schema import Index as Index from .sql.schema import MetaData as MetaData from .sql.schema import PrimaryKeyConstraint as PrimaryKeyConstraint +from .sql.schema import SchemaConst as SchemaConst from .sql.schema import SchemaItem as SchemaItem from .sql.schema import Sequence as Sequence from .sql.schema import Table as Table diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py index 472979952..598bacc59 100644 --- a/lib/sqlalchemy/sql/schema.py +++ b/lib/sqlalchemy/sql/schema.py @@ -1450,7 +1450,7 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): value automatically for this column, which will be accessible after the statement is invoked via the :attr:`.CursorResult.inserted_primary_key` attribute upon the - :class:`.Result` object. This also applies towards use of the + :class:`_result.Result` object. This also applies towards use of the ORM when ORM-mapped objects are persisted to the database, indicating that a new integer primary key will be available to become part of the :term:`identity key` for that object. This @@ -1497,9 +1497,9 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): Column('id', ForeignKey('other.id'), primary_key=True, autoincrement='ignore_fk') - It is typically not desirable to have "autoincrement" enabled on a - column that refers to another via foreign key, as such a column is - required to refer to a value that originates from elsewhere. + It is typically not desirable to have "autoincrement" enabled on a + column that refers to another via foreign key, as such a column is + required to refer to a value that originates from elsewhere. The setting has these effects on columns that meet the above criteria: @@ -1537,9 +1537,9 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): using a method specific to the database driver in use: * MySQL, SQLite - calling upon ``cursor.lastrowid()`` - (see - `https://www.python.org/dev/peps/pep-0249/#lastrowid - <https://www.python.org/dev/peps/pep-0249/#lastrowid>`_) + (see + `https://www.python.org/dev/peps/pep-0249/#lastrowid + <https://www.python.org/dev/peps/pep-0249/#lastrowid>`_) * PostgreSQL, SQL Server, Oracle - use RETURNING or an equivalent construct when rendering an INSERT statement, and then retrieving the newly generated primary key values after execution @@ -1564,7 +1564,6 @@ class Column(DialectKWArgs, SchemaItem, ColumnClause[_T]): "fast insertmany" feature. Such features are very new and may not yet be well covered in documentation. - :param default: A scalar, Python callable, or :class:`_expression.ColumnElement` expression representing the *default value* for this column, which will be invoked upon insert diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index fd98f17e3..733def377 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -1078,7 +1078,7 @@ class SelectLabelStyle(Enum): Below, all column names are given a label so that the two same-named columns ``columna`` are disambiguated as ``table1_columna`` and - ``table2_columna`:: + ``table2_columna``:: >>> from sqlalchemy import table, column, select, true, LABEL_STYLE_TABLENAME_PLUS_COL >>> table1 = table("table1", column("columna"), column("columnb")) diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py index e54f33475..a23bee875 100644 --- a/lib/sqlalchemy/util/langhelpers.py +++ b/lib/sqlalchemy/util/langhelpers.py @@ -1225,7 +1225,11 @@ class HasMemoized: self._memoized_keys |= {key} class memoized_attribute(memoized_property[_T]): - """A read-only @property that is only evaluated once.""" + """A read-only @property that is only evaluated once. + + :meta private: + + """ fget: Callable[..., _T] __doc__: Optional[str] @@ -1254,7 +1258,11 @@ class HasMemoized: @classmethod def memoized_instancemethod(cls, fn: _F) -> _F: - """Decorate a method memoize its return value.""" + """Decorate a method memoize its return value. + + :meta private: + + """ def oneshot(self: Any, *args: Any, **kw: Any) -> Any: result = fn(self, *args, **kw) |