summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine/interfaces.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-04-14 13:15:21 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-04-14 13:15:21 -0400
commitcea03be855514d592b6671fa6dbc074a19a795fb (patch)
treef127540bda77a4ea5d9935cffedf04d8b01776a9 /lib/sqlalchemy/engine/interfaces.py
parenta898ade3bc36ca27cf9475d1348249646eb40e95 (diff)
downloadsqlalchemy-cea03be855514d592b6671fa6dbc074a19a795fb.tar.gz
Run search and replace of symbolic module names
Replaces a wide array of Sphinx-relative doc references with an abbreviated absolute form now supported by zzzeeksphinx. Change-Id: I94bffcc3f37885ffdde6238767224296339698a2
Diffstat (limited to 'lib/sqlalchemy/engine/interfaces.py')
-rw-r--r--lib/sqlalchemy/engine/interfaces.py128
1 files changed, 71 insertions, 57 deletions
diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py
index 6cf4d7dbd..224d4f693 100644
--- a/lib/sqlalchemy/engine/interfaces.py
+++ b/lib/sqlalchemy/engine/interfaces.py
@@ -185,7 +185,7 @@ class Dialect(object):
"""Transform a generic type to a dialect-specific type.
Dialect classes will usually use the
- :func:`.types.adapt_type` function in the types module to
+ :func:`_types.adapt_type` function in the types module to
accomplish this.
The returned result is cached *per dialect class* so can
@@ -215,7 +215,7 @@ class Dialect(object):
def get_columns(self, connection, table_name, schema=None, **kw):
"""Return information about columns in `table_name`.
- Given a :class:`.Connection`, a string
+ Given a :class:`_engine.Connection`, a string
`table_name`, and an optional string `schema`, return column
information as a list of dictionaries with these keys:
@@ -249,7 +249,7 @@ class Dialect(object):
"""Return information about the primary key constraint on
table_name`.
- Given a :class:`.Connection`, a string
+ Given a :class:`_engine.Connection`, a string
`table_name`, and an optional string `schema`, return primary
key information as a dictionary with these keys:
@@ -265,7 +265,7 @@ class Dialect(object):
def get_foreign_keys(self, connection, table_name, schema=None, **kw):
"""Return information about foreign_keys in `table_name`.
- Given a :class:`.Connection`, a string
+ Given a :class:`_engine.Connection`, a string
`table_name`, and an optional string `schema`, return foreign
key information as a list of dicts with these keys:
@@ -321,7 +321,7 @@ class Dialect(object):
def get_view_definition(self, connection, view_name, schema=None, **kw):
"""Return view definition.
- Given a :class:`.Connection`, a string
+ Given a :class:`_engine.Connection`, a string
`view_name`, and an optional string `schema`, return the view
definition.
"""
@@ -331,7 +331,7 @@ class Dialect(object):
def get_indexes(self, connection, table_name, schema=None, **kw):
"""Return information about indexes in `table_name`.
- Given a :class:`.Connection`, a string
+ Given a :class:`_engine.Connection`, a string
`table_name` and an optional string `schema`, return index
information as a list of dictionaries with these keys:
@@ -434,7 +434,7 @@ class Dialect(object):
def has_table(self, connection, table_name, schema=None, **kw):
"""Check the existence of a particular table in the database.
- Given a :class:`.Connection` object and a string
+ Given a :class:`_engine.Connection` object and a string
`table_name`, return True if the given table (possibly within
the specified `schema`) exists in the database, False
otherwise.
@@ -445,7 +445,7 @@ class Dialect(object):
def has_index(self, connection, table_name, index_name, schema=None):
"""Check the existence of a particular index name in the database.
- Given a :class:`.Connection` object, a string
+ Given a :class:`_engine.Connection` object, a string
`table_name` and stiring index name, return True if an index of the
given name on the given table exists, false otherwise.
@@ -463,7 +463,7 @@ class Dialect(object):
def has_sequence(self, connection, sequence_name, schema=None, **kw):
"""Check the existence of a particular sequence in the database.
- Given a :class:`.Connection` object and a string
+ Given a :class:`_engine.Connection` object and a string
`sequence_name`, return True if the given sequence exists in
the database, False otherwise.
"""
@@ -506,7 +506,8 @@ class Dialect(object):
:meth:`.Dialect.do_autocommit`
hook is provided for DBAPIs that need some extra commands emitted
after a commit in order to enter the next transaction, when the
- SQLAlchemy :class:`.Connection` is used in its default "autocommit"
+ SQLAlchemy :class:`_engine.Connection`
+ is used in its default "autocommit"
mode.
:param dbapi_connection: a DBAPI connection, typically
@@ -542,7 +543,8 @@ class Dialect(object):
"""Provide an implementation of ``connection.close()``, given a DBAPI
connection.
- This hook is called by the :class:`.Pool` when a connection has been
+ This hook is called by the :class:`_pool.Pool`
+ when a connection has been
detached from the pool, or is being returned beyond the normal
capacity of the pool.
@@ -563,7 +565,7 @@ class Dialect(object):
def do_savepoint(self, connection, name):
"""Create a savepoint with the given name.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
:param name: savepoint name.
"""
@@ -573,7 +575,7 @@ class Dialect(object):
def do_rollback_to_savepoint(self, connection, name):
"""Rollback a connection to the named savepoint.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
:param name: savepoint name.
"""
@@ -583,7 +585,7 @@ class Dialect(object):
def do_release_savepoint(self, connection, name):
"""Release the named savepoint on a connection.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
:param name: savepoint name.
"""
@@ -592,7 +594,7 @@ class Dialect(object):
def do_begin_twophase(self, connection, xid):
"""Begin a two phase transaction on the given connection.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
:param xid: xid
"""
@@ -602,7 +604,7 @@ class Dialect(object):
def do_prepare_twophase(self, connection, xid):
"""Prepare a two phase transaction on the given connection.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
:param xid: xid
"""
@@ -614,7 +616,7 @@ class Dialect(object):
):
"""Rollback a two phase transaction on the given connection.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
:param xid: xid
:param is_prepared: whether or not
:meth:`.TwoPhaseTransaction.prepare` was called.
@@ -630,7 +632,7 @@ class Dialect(object):
"""Commit a two phase transaction on the given connection.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
:param xid: xid
:param is_prepared: whether or not
:meth:`.TwoPhaseTransaction.prepare` was called.
@@ -644,7 +646,7 @@ class Dialect(object):
"""Recover list of uncommitted prepared two phase transaction
identifiers on the given connection.
- :param connection: a :class:`.Connection`.
+ :param connection: a :class:`_engine.Connection`.
"""
@@ -734,11 +736,13 @@ class Dialect(object):
isolation modes, Unicode modes, etc.
The "do_on_connect" callable is invoked by using the
- :meth:`.PoolEvents.first_connect` and :meth:`.PoolEvents.connect` event
+ :meth:`_events.PoolEvents.first_connect` and
+ :meth:`_events.PoolEvents.connect` event
hooks, then unwrapping the DBAPI connection and passing it into the
callable. The reason it is invoked for both events is so that any
dialect-level initialization that occurs upon first connection, which
- also makes use of the :meth:`.PoolEvents.first_connect` method, will
+ also makes use of the :meth:`_events.PoolEvents.first_connect` method,
+ will
proceed after this hook has been called. This currently means the
hook is in fact called twice for the very first connection in which a
dialect creates; and once per connection afterwards.
@@ -760,22 +764,24 @@ class Dialect(object):
"""Given a DBAPI connection, revert its isolation to the default.
Note that this is a dialect-level method which is used as part
- of the implementation of the :class:`.Connection` and
- :class:`.Engine`
+ of the implementation of the :class:`_engine.Connection` and
+ :class:`_engine.Engine`
isolation level facilities; these APIs should be preferred for
most typical use cases.
.. seealso::
- :meth:`.Connection.get_isolation_level` - view current level
+ :meth:`_engine.Connection.get_isolation_level`
+ - view current level
- :attr:`.Connection.default_isolation_level` - view default level
+ :attr:`_engine.Connection.default_isolation_level`
+ - view default level
:paramref:`.Connection.execution_options.isolation_level` -
- set per :class:`.Connection` isolation level
+ set per :class:`_engine.Connection` isolation level
:paramref:`.create_engine.isolation_level` -
- set per :class:`.Engine` isolation level
+ set per :class:`_engine.Engine` isolation level
"""
@@ -785,22 +791,24 @@ class Dialect(object):
"""Given a DBAPI connection, set its isolation level.
Note that this is a dialect-level method which is used as part
- of the implementation of the :class:`.Connection` and
- :class:`.Engine`
+ of the implementation of the :class:`_engine.Connection` and
+ :class:`_engine.Engine`
isolation level facilities; these APIs should be preferred for
most typical use cases.
.. seealso::
- :meth:`.Connection.get_isolation_level` - view current level
+ :meth:`_engine.Connection.get_isolation_level`
+ - view current level
- :attr:`.Connection.default_isolation_level` - view default level
+ :attr:`_engine.Connection.default_isolation_level`
+ - view default level
:paramref:`.Connection.execution_options.isolation_level` -
- set per :class:`.Connection` isolation level
+ set per :class:`_engine.Connection` isolation level
:paramref:`.create_engine.isolation_level` -
- set per :class:`.Engine` isolation level
+ set per :class:`_engine.Engine` isolation level
"""
@@ -809,27 +817,30 @@ class Dialect(object):
def get_isolation_level(self, dbapi_conn):
"""Given a DBAPI connection, return its isolation level.
- When working with a :class:`.Connection` object, the corresponding
+ When working with a :class:`_engine.Connection` object,
+ the corresponding
DBAPI connection may be procured using the
- :attr:`.Connection.connection` accessor.
+ :attr:`_engine.Connection.connection` accessor.
Note that this is a dialect-level method which is used as part
- of the implementation of the :class:`.Connection` and
- :class:`.Engine` isolation level facilities;
+ of the implementation of the :class:`_engine.Connection` and
+ :class:`_engine.Engine` isolation level facilities;
these APIs should be preferred for most typical use cases.
.. seealso::
- :meth:`.Connection.get_isolation_level` - view current level
+ :meth:`_engine.Connection.get_isolation_level`
+ - view current level
- :attr:`.Connection.default_isolation_level` - view default level
+ :attr:`_engine.Connection.default_isolation_level`
+ - view default level
:paramref:`.Connection.execution_options.isolation_level` -
- set per :class:`.Connection` isolation level
+ set per :class:`_engine.Connection` isolation level
:paramref:`.create_engine.isolation_level` -
- set per :class:`.Engine` isolation level
+ set per :class:`_engine.Engine` isolation level
"""
@@ -883,7 +894,8 @@ class Dialect(object):
@classmethod
def engine_created(cls, engine):
- """A convenience hook called before returning the final :class:`.Engine`.
+ """A convenience hook called before returning the final
+ :class:`_engine.Engine`.
If the dialect returned a different class from the
:meth:`.get_dialect_cls`
@@ -903,7 +915,7 @@ class Dialect(object):
class CreateEnginePlugin(object):
"""A set of hooks intended to augment the construction of an
- :class:`.Engine` object based on entrypoint names in a URL.
+ :class:`_engine.Engine` object based on entrypoint names in a URL.
The purpose of :class:`.CreateEnginePlugin` is to allow third-party
systems to apply engine, pool and dialect level event listeners without
@@ -979,7 +991,7 @@ class CreateEnginePlugin(object):
arguments afterwards.
When the engine creation process completes and produces the
- :class:`.Engine` object, it is again passed to the plugin via the
+ :class:`_engine.Engine` object, it is again passed to the plugin via the
:meth:`.CreateEnginePlugin.engine_created` hook. In this hook, additional
changes can be made to the engine, most typically involving setup of
events (e.g. those defined in :ref:`core_event_toplevel`).
@@ -992,7 +1004,7 @@ class CreateEnginePlugin(object):
"""Construct a new :class:`.CreateEnginePlugin`.
The plugin object is instantiated individually for each call
- to :func:`.create_engine`. A single :class:`.Engine` will be
+ to :func:`.create_engine`. A single :class:`_engine.Engine` will be
passed to the :meth:`.CreateEnginePlugin.engine_created` method
corresponding to this URL.
@@ -1015,7 +1027,8 @@ class CreateEnginePlugin(object):
"""parse and modify pool kwargs"""
def engine_created(self, engine):
- """Receive the :class:`.Engine` object when it is fully constructed.
+ """Receive the :class:`_engine.Engine`
+ object when it is fully constructed.
The plugin may make additional changes to the engine, such as
registering engine or connection pool events.
@@ -1246,9 +1259,9 @@ class ExecutionContext(object):
@util.deprecated_20_cls(
":class:`.Connectable`",
alternative=(
- "The :class:`.Engine` will be the only Core "
+ "The :class:`_engine.Engine` will be the only Core "
"object that features a .connect() method, and the "
- ":class:`.Connection` will be the only object that features "
+ ":class:`_engine.Connection` will be the only object that features "
"an .execute() method."
),
constructor=None,
@@ -1257,7 +1270,7 @@ class Connectable(object):
"""Interface for an object which supports execution of SQL constructs.
The two implementations of :class:`.Connectable` are
- :class:`.Connection` and :class:`.Engine`.
+ :class:`_engine.Connection` and :class:`_engine.Engine`.
Connectable must also implement the 'dialect' member which references a
:class:`.Dialect` instance.
@@ -1265,19 +1278,20 @@ class Connectable(object):
"""
def connect(self, **kwargs):
- """Return a :class:`.Connection` object.
+ """Return a :class:`_engine.Connection` object.
Depending on context, this may be ``self`` if this object
- is already an instance of :class:`.Connection`, or a newly
- procured :class:`.Connection` if this object is an instance
- of :class:`.Engine`.
+ is already an instance of :class:`_engine.Connection`, or a newly
+ procured :class:`_engine.Connection` if this object is an instance
+ of :class:`_engine.Engine`.
"""
engine = None
- """The :class:`.Engine` instance referred to by this :class:`.Connectable`.
+ """The :class:`_engine.Engine` instance referred to by this
+ :class:`.Connectable`.
- May be ``self`` if this is already an :class:`.Engine`.
+ May be ``self`` if this is already an :class:`_engine.Engine`.
"""
@@ -1311,7 +1325,7 @@ class ExceptionContext(object):
"""
connection = None
- """The :class:`.Connection` in use during the exception.
+ """The :class:`_engine.Connection` in use during the exception.
This member is present, except in the case of a failure when
first connecting.
@@ -1324,7 +1338,7 @@ class ExceptionContext(object):
"""
engine = None
- """The :class:`.Engine` in use during the exception.
+ """The :class:`_engine.Engine` in use during the exception.
This member should always be present, even in the case of a failure
when first connecting.