summaryrefslogtreecommitdiff
path: root/doc/build/errors.rst
diff options
context:
space:
mode:
authorjonathan vanasco <jonathan@2xlp.com>2021-08-23 16:25:21 -0400
committerjonathan vanasco <jonathan@2xlp.com>2021-08-23 16:25:21 -0400
commit369edbbd674c2dcdc121072a20b3f9d259f9ee91 (patch)
tree92c8f145ce641e8170a48e900c54e2eac22be42d /doc/build/errors.rst
parent207ec35c2e175f5fcf68e886d5e61a0678c2d6fc (diff)
downloadsqlalchemy-369edbbd674c2dcdc121072a20b3f9d259f9ee91.tar.gz
standardizing docs #6821
(redo of 2999/I5609025feee8cfdecc09b55bfbf1bd13fa2e6602) This PR is designed to bring more clarity within the docs by renaming object instances that may be consfusingly similar to class, method, and attribute names. For example, instances of the class `MetaData` are available on some objects as `.metadata` property, and had appeared within the docs as both `meta` and `metadata` which has confused some users in the past. By this PR, the docs now utilize the following naming convention: * MetaData - SQLAlchemy class * .metadata - SQLAlchemy API attributes * metadata_obj - developer instantiated metadata objects or references Detailed Changes: * standardized `meta` and `metadata` instances to `metadata_obj`. note: the docs were evenly split between 'meta' and 'metadata'. * standardized 'cursor' to 'cursor_obj' to avoid confusion with the method. * standardized a 'scalar_subquery = ' to 'scalar_subq' to avoid confusion with the method. * standardized a 'cte = ' to 'cte_obj' to avoid confusion with the method Change-Id: I79c98aee16c5fc6649289b2dd7d6dfc368222fb4
Diffstat (limited to 'doc/build/errors.rst')
-rw-r--r--doc/build/errors.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/doc/build/errors.rst b/doc/build/errors.rst
index 8034475e8..5081928dd 100644
--- a/doc/build/errors.rst
+++ b/doc/build/errors.rst
@@ -139,8 +139,8 @@ the :class:`_orm.Session` or
engine = create_engine("sqlite://")
Session = sessionmaker()
- metadata = MetaData(bind=engine)
- Base = declarative_base(metadata=metadata)
+ metadata_obj = MetaData(bind=engine)
+ Base = declarative_base(metadata=metadata_obj)
class MyClass(Base):
# ...
@@ -677,8 +677,8 @@ This error refers to the concept of "bound metadata", described at
:meth:`.Executable.execute` method directly off of a Core expression object
that is not associated with any :class:`_engine.Engine`::
- metadata = MetaData()
- table = Table('t', metadata, Column('q', Integer))
+ metadata_obj = MetaData()
+ table = Table('t', metadata_obj, Column('q', Integer))
stmt = select(table)
result = stmt.execute() # <--- raises
@@ -687,7 +687,7 @@ What the logic is expecting is that the :class:`_schema.MetaData` object has
been **bound** to a :class:`_engine.Engine`::
engine = create_engine("mysql+pymysql://user:pass@host/db")
- metadata = MetaData(bind=engine)
+ metadata_obj = MetaData(bind=engine)
Where above, any statement that derives from a :class:`_schema.Table` which
in turn derives from that :class:`_schema.MetaData` will implicitly make use of