MCPcopy
hub / github.com/django/django / extension_exists

Method extension_exists

django/contrib/postgres/operations.py:58–64  ·  view source on GitHub ↗
(self, schema_editor, extension)

Source from the content-addressed store, hash-verified

56 get_citext_oids.cache_clear()
57
58 def extension_exists(self, schema_editor, extension):
59 with schema_editor.connection.cursor() as cursor:
60 cursor.execute(
61 "SELECT 1 FROM pg_extension WHERE extname = %s",
62 [extension],
63 )
64 return bool(cursor.fetchone())
65
66 def describe(self):
67 return "Creates extension %s" % self.name

Callers 2

database_forwardsMethod · 0.95
database_backwardsMethod · 0.95

Calls 2

cursorMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected