MCPcopy
hub / github.com/django/django / _configure_role

Method _configure_role

django/db/backends/postgresql/base.py:373–379  ·  view source on GitHub ↗
(self, connection)

Source from the content-addressed store, hash-verified

371 return False
372
373 def _configure_role(self, connection):
374 if new_role := self.settings_dict["OPTIONS"].get("assume_role"):
375 with connection.cursor() as cursor:
376 sql = self.ops.compose_sql("SET ROLE %s", [new_role])
377 cursor.execute(sql)
378 return True
379 return False
380
381 def _configure_connection(self, connection):
382 # This function is called from init_connection_state and from the

Callers 1

_configure_connectionMethod · 0.95

Calls 4

cursorMethod · 0.80
compose_sqlMethod · 0.80
getMethod · 0.45
executeMethod · 0.45

Tested by

no test coverage detected