Backend Tables

Metadata Tables in your generated backend

Metamug Console creates a set of tables in the backend database which are used by the console to store information about error logs, request statistics, query catalog data, user authentication etc. However, these tables are not required when the application is deployed in production. So, these tables can be dropped and we can provide you a script for the same.

The following tables are created by Metamug console in the database when backend is created.

Log Tables

The tables described in points 1,2,3,4 are used by the Metamug console during development and have no useful purpose during production. So we can provide you a script to drop these tables from your production database.

  1. error_log This table holds error logs occurring when API requests are made.
  2. query_log This table contains a history of the SQL queries executed using the SQL-editor in the console.
  3. request_log This table contains information of every request made to the API. This is used for showing the API request statistics in the console.

SQL References

  1. mtg_query_catalog,
  2. mtg_query_reference,
  3. mtg_query_tag,
  4. mtg_query_test_data

These four tables are used by SQL Catalog Screen and query test feature which enables the user to test a SQL query using optional test data before creating the API.

User Entitlement

Metamug Auth Properties

These tables are used for Authentication of resources as described on the auth page. More importantly, the MTG_AUTH properties are only essential as it contains the SQL query for authentication. The two tables (usr, usr_roles) are only provided as default and can be replaced by any other tables containing user data. So, if we remove MTG_AUTH properties, resource authentication feature will no longer be available for use.

  1. usr This is the default user table.
  2. usr_role This table defines the role and has a foreign key to the user table.

These two are default tables provided for user entitlement to resources. They can be used to store user and roles data or alternatively, any other tables can be used.

Production Use

In addition to the above, we recommend you to not use Metamug console with your production database. Instead, you can connect your development database with the console for API development and then export your backend for use in production.

If you would like to drop these tables use the following script.

-- Console tables
DROP TABLE IF EXISTS error_log;
DROP TABLE IF EXISTS query_log;
DROP TABLE IF EXISTS request_log;

-- Query Reference Tables
DROP TABLE IF EXISTS mtg_query_reference;
DROP TABLE IF EXISTS mtg_query_tag;
DROP TABLE IF EXISTS mtg_query_test_data;
DROP TABLE IF EXISTS mtg_query_catalog;

-- Auth Tables
DROP TABLE IF EXISTS usr;
DROP TABLE IF EXISTS usr_role; 
Icon For Arrow-up