MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / _comment_query

Method _comment_query

lib/sqlalchemy/dialects/postgresql/base.py:5158–5183  ·  view source on GitHub ↗
(self, schema, has_filter_names, scope, kind)

Source from the content-addressed store, hash-verified

5156
5157 @lru_cache()
5158 def _comment_query(self, schema, has_filter_names, scope, kind):
5159 relkinds = self._kind_to_relkinds(kind)
5160 query = (
5161 select(
5162 pg_catalog.pg_class.c.relname,
5163 pg_catalog.pg_description.c.description,
5164 )
5165 .select_from(pg_catalog.pg_class)
5166 .outerjoin(
5167 pg_catalog.pg_description,
5168 sql.and_(
5169 pg_catalog.pg_class.c.oid
5170 == pg_catalog.pg_description.c.objoid,
5171 pg_catalog.pg_description.c.objsubid == 0,
5172 pg_catalog.pg_description.c.classoid
5173 == sql.func.cast("pg_catalog.pg_class", REGCLASS),
5174 ),
5175 )
5176 .where(self._pg_class_relkind_condition(relkinds))
5177 )
5178 query = self._pg_class_filter_scope_schema(query, schema, scope)
5179 if has_filter_names:
5180 query = query.where(
5181 pg_catalog.pg_class.c.relname.in_(bindparam("filter_names"))
5182 )
5183 return query
5184
5185 def get_multi_table_comment(
5186 self, connection, schema, filter_names, scope, kind, **kw

Callers 1

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