MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _has_pg_extension

Method _has_pg_extension

test/requirements.py:1649–1660  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

1647 return exclusions.open()
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
1662 @property
1663 def hstore(self):

Callers 3

hstoreMethod · 0.95
citextMethod · 0.95
btree_gistMethod · 0.95

Calls 1

only_ifFunction · 0.90

Tested by

no test coverage detected