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

Method check

test/requirements.py:1579–1587  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

1577
1578 def _has_pg_extension(self, name):
1579 def check(config):
1580 if not against(config, "postgresql"):
1581 return False
1582 with config.db.connect() as conn:
1583 count = conn.exec_driver_sql(
1584 "SELECT count(*) FROM pg_extension "
1585 "WHERE extname='%s'" % name
1586 ).scalar()
1587 return bool(count)
1588
1589 return only_if(check, "needs %s extension" % name)
1590

Callers

nothing calls this directly

Calls 8

againstFunction · 0.90
_list_dblinksMethod · 0.80
connectMethod · 0.45
scalarMethod · 0.45
exec_driver_sqlMethod · 0.45
getMethod · 0.45
normalize_nameMethod · 0.45
firstMethod · 0.45

Tested by

no test coverage detected