summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/build/core/reflection.rst4
-rw-r--r--lib/sqlalchemy/engine/reflection.py4
-rw-r--r--lib/sqlalchemy/inspection.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/doc/build/core/reflection.rst b/doc/build/core/reflection.rst
index c320478a0..b95d3e44a 100644
--- a/doc/build/core/reflection.rst
+++ b/doc/build/core/reflection.rst
@@ -131,9 +131,9 @@ lists of schema, table, column, and constraint descriptions from a given
database is also available. This is known as the "Inspector"::
from sqlalchemy import create_engine
- from sqlalchemy.engine import reflection
+ from sqlalchemy import inspect
engine = create_engine('...')
- insp = reflection.Inspector.from_engine(engine)
+ insp = inspect(engine)
print(insp.get_table_names())
.. autoclass:: sqlalchemy.engine.reflection.Inspector
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py
index 142637693..c5d66081a 100644
--- a/lib/sqlalchemy/engine/reflection.py
+++ b/lib/sqlalchemy/engine/reflection.py
@@ -712,12 +712,12 @@ class Inspector(object):
table reflection. Direct usage is like::
from sqlalchemy import create_engine, MetaData, Table
- from sqlalchemy.engine.reflection import Inspector
+ from sqlalchemy import inspect
engine = create_engine('...')
meta = MetaData()
user_table = Table('user', meta)
- insp = Inspector.from_engine(engine)
+ insp = inspect(engine)
insp.reflect_table(user_table, None)
.. versionchanged:: 1.4 Renamed from ``reflecttable`` to
diff --git a/lib/sqlalchemy/inspection.py b/lib/sqlalchemy/inspection.py
index 4d9ee30c4..69b160ce7 100644
--- a/lib/sqlalchemy/inspection.py
+++ b/lib/sqlalchemy/inspection.py
@@ -20,7 +20,7 @@ cases it will return the object itself.
The rationale for :func:`_sa.inspect` is twofold. One is that
it replaces the need to be aware of a large variety of "information
getting" functions in SQLAlchemy, such as
-:meth:`_reflection.Inspector.from_engine`,
+:meth:`_reflection.Inspector.from_engine` (deprecated in 1.4),
:func:`.orm.attributes.instance_state`, :func:`_orm.class_mapper`,
and others. The other is that the return value of :func:`_sa.inspect`
is guaranteed to obey a documented API, thus allowing third party