Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Starting v9.0, you can use the Database Console to execute SQL queries via the OpenSpecimen app. This eliminates the need to log in to the DB VM to run a SQL queries.

Note
  1. Only super admins can access the database console. 

  2. Ensure email settings are configured.

  3. On your user profile: Ensure the correct email ID is mentioned on your user profile and “Disable notifications” is set to “No.”

...

Accessing the database should be done only in extreme situations when an operation cannot be done you cannot do the same operation via the User Interface. However, it is unavoidable at times. E.g., reverting a deleted object, resetting a token sequence, debugging a slow query, etc.

Which type of SQLs are allowed?

Allowed

...

  1. DESCRIBE, SHOW CREATE, SHOW ON TABLES, TRIGGERS, PROCEDURES

  2. INSERT, UPDATE, DELETE records in TABLES (DML statements)

  3. Explain plan (to debug slow queries)

Not allowed

...

CREATE, DROP, ALTER, TRUNCATE TABLES, or any other objects.

How to access the Database Console?

Navigate to the ‘Extras’ → Database Console.

...

  1. Paste the SQL and click on the Run button.

  2. Displays the output of the SQL

  3. Shows the history of SQLs that you have executed in this session.

...

Audit: How to view the history of SQLs run?

You can download all past sessions and SQLs run by any super admin in the past. Click on the “Download” button to get a CSV file with all the information in a session.

...