We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from django.db.backends.postgresql import base class DatabaseWrapper(base.DatabaseWrapper): def get_new_connection(self, conn_params): conn = super(DatabaseWrapper, self).get_new_connection(conn_params) if hasattr(conn, 'read_only'): # pyscopg3 conn.read_only = True elif hasattr(conn, 'set_session'): # pyscopg2 conn.set_session(readonly=True) else: raise RuntimeError("pg_readonly: unknown adapter type (only pyscopg2 and pyscopg3 are supported)") return conn
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: