MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _comment_query

Method _comment_query

lib/sqlalchemy/dialects/postgresql/base.py:5315–5340  ·  lib/sqlalchemy/dialects/postgresql/base.py::PGDialect._comment_query
(self, schema, has_filter_names, scope, kind)

Source from the content-addressed store, hash-verified

5313
5314 @lru_cache()
5315 def _comment_query(self, schema, has_filter_names, scope, kind):
5316 relkinds = self._kind_to_relkinds(kind)
5317 query = (
5318 select(
5319 pg_catalog.pg_class.c.relname,
5320 pg_catalog.pg_description.c.description,
5321 )
5322 .select_from(pg_catalog.pg_class)
5323 .outerjoin(
5324 pg_catalog.pg_description,
5325 sql.and_(
5326 pg_catalog.pg_class.c.oid
5327 == pg_catalog.pg_description.c.objoid,
5328 pg_catalog.pg_description.c.objsubid == 0,
5329 pg_catalog.pg_description.c.classoid
5330 == sql.func.cast(class="st">"pg_catalog.pg_class", REGCLASS),
5331 ),
5332 )
5333 .where(self._pg_class_relkind_condition(relkinds))
5334 )
5335 query = self._pg_class_filter_scope_schema(query, schema, scope)
5336 if has_filter_names:
5337 query = query.where(
5338 pg_catalog.pg_class.c.relname.in_(bindparam(class="st">"filter_names"))
5339 )
5340 return query
5341
5342 def get_multi_table_comment(
5343 self, connection, schema, filter_names, scope, kind, **kw

Callers 2

init_classMethod · 0.95

Calls 11

_kind_to_relkindsMethod · 0.95
selectFunction · 0.90
bindparamFunction · 0.85
whereMethod · 0.45
outerjoinMethod · 0.45
select_fromMethod · 0.45
and_Method · 0.45
castMethod · 0.45
in_Method · 0.45

Tested by

no test coverage detected