MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / check

Method check

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

Source from the content-addressed store, hash-verified

1648
1649 def _has_pg_extension(self, name):
1650 def check(config):
1651 if not against(config, "postgresql"):
1652 return False
1653 with config.db.connect() as conn:
1654 count = conn.exec_driver_sql(
1655 "SELECT count(*) FROM pg_extension "
1656 "WHERE extname='%s'" % name
1657 ).scalar()
1658 return bool(count)
1659
1660 return only_if(check, "needs %s extension" % name)
1661

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