You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Django's database API has an is_usable method, implemented by all backends that abstracts away this query (for example it does SELECT 1 query on PostgreSQL and connection.ping() on MySQL).
So let's reuse that. Means getting the backend from django.db.connections, creating a connection, and calling the is_usable() method.
Using django.db.connections would also be a first step to being implementing #4.
The text was updated successfully, but these errors were encountered:
Replace the current 'SELECT 1' query, with a database independent solution. 'SELECT 1' does not work on backends like Oracle and DB2.
This is a follow-up on #8.
Proposal
Django's database API has an
is_usable
method, implemented by all backends that abstracts away this query (for example it doesSELECT 1
query on PostgreSQL andconnection.ping()
on MySQL).So let's reuse that. Means getting the backend from
django.db.connections
, creating a connection, and calling the is_usable() method.Using
django.db.connections
would also be a first step to being implementing #4.The text was updated successfully, but these errors were encountered: