MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / check_extension_exists

Function check_extension_exists

web/pgadmin/utils/__init__.py:1001–1014  ·  view source on GitHub ↗
(conn, extension_name)

Source from the content-addressed store, hash-verified

999
1000
1001def check_extension_exists(conn, extension_name):
1002 sql = (
1003 "SELECT 1 FROM pg_catalog.pg_extension "
1004 "WHERE extname = %s"
1005 )
1006 status, res = conn.execute_scalar(sql, [extension_name])
1007 if status:
1008 if res:
1009 return status, True
1010 else:
1011 return status, False
1012 else:
1013 # If the query fails, we assume the extension does not exist
1014 return status, res

Callers 1

get_geometry_typesMethod · 0.90

Calls 1

execute_scalarMethod · 0.45

Tested by

no test coverage detected