Commands List
Documentation for all the available CLI/REPL/Server actions
add a new connection
- name (string) - the name of the new connection, optional
- type (string) - the type of the connection, optional
- connectionString (string) - the connection string, optional
- description (string) - the connetion description, optional
Start an add-connection prompt
Javascript
addConnection()
Shell
metis add-connection
Add a connection with name, type, connection-string and description
Javascript
addConnection("localPostgresDB", "postgres", "postgresql://user:[email protected]:5432/dbname", "Dev Postgres connection")
Shell
metis add-connection "localPostgresDB" "postgres" "postgresql://user:[email protected]:5432/dbname" "Dev Postgres connection"
Javascript
addConnection("mysqlLocalCon", "mysql", "mysql://root:[email protected]:3306/database_name", "Dev Mysql connection")
Shell
metis add-connection "mysqlLocalCon" "mysql" "mysql://root:[email protected]:3306/database_name" "Dev Mysql connection"
The 'connect' action connects to a given connection by name. If the connection exists, the tables, and their additional information would be pulled from the database. The connection is not actually kept open. A connection will be made whenever a request to the database is made.
- connectionName (string) - the name of the connection, required
Javascript
connect("connection-name")
Shell
metis --connect "connection-name"
remove a given connection from file
- connectionName (string) - the name of the connection, required
Javascript
deleteConnection("connection-name")
Shell
metis delete-connection "connection-name"
edit a connection
- connectionName (string) - the name of the connection, required
- name (string) - the name of the updated connection
- type (string) - the type of the updated connection
- username (string) - the user name for the updated connection
- password (string) - the password for the updated connection
- host (string) - the host for the updated connection
- port (number) - the port for the updated connection
- description (string) - the updated connetion description
show the existing connections
set the default connection and connects to it
- connectionName (string) - the name of the connection, required
Javascript
setDefaultConnection("connection-name")
Shell
metis set-default-connection "connection-name"
test the given connection
- connectionName (string) - the name of the connection, required
Change the name of a given connection
- connectionName (string) - the name of the connection, required
- newConnectionName (string) - the new name for the connection, required
Javascript
updateConnectionName("old-connection-name", "new-connection-name")
Shell
metis update-connection-name "old-connection-name" "new-connection-name"
describe a given metric
- metric (string) - name of the metric, required
describe a rule by given id
- id (string) - the id of the rule, required
- facts (object) - an object containing facts, optional
Javascript
descRule("QRY000001")
Shell
metis desc-rule "QRY000001"
Javascript
descRule("QRY000001", { 'actual-rows-read': 1000000 })
Shell
metis desc-rule "QRY000001" '{"actual-rows-read":1000000}'
describes a given table
- twoPartName (string) - name of the database and table connected with a dot, required
Javascript
descTable("schema.table-name")
Shell
metis desc-table "schema.table-name"
print the tables list for the current connection
print a report of available facts
get an execution plan for a given query
- query (string) - query to analyze , required
Show the User Defined Functions (UDF) in the DB
The 'queryAnalysisPG' action runs an analysis on a given query. The output can be controlled using option parameters.
- query (string) - query to analyze, required
- showFormattedSql (boolean) - show formatted SQL, default: true
- showPlan (boolean) - show simplified execution plan
- showExplain (boolean) - show explain information
- showMetrics (boolean) - show the facts gathered from the execution plan, default: true
- showTableInfo (boolean) - show table info, default: true
- showTableIndexInfo (boolean) - show table index/es info
- showInsights (boolean) - show insights information, default: true
- routeName (string) - route name, default: "metis/cli/queryAnalysis"
- tag (string) - tag name, default: "PR"
- showAllInsights (boolean) - show all the insight include skipped, success, low, very low and info, default: true
- execPlanType (enum) - run execution plan with chosen mode actual/estimated, default: "Estimated", values: ["Actual", "Estimated"]
- showMetricsDiff (boolean) - show the diff between all the existing metrics to the generated metrics
Javascript
queryAnalysis("SELECT * FROM TableName")
Shell
metis query-analysis "SELECT * FROM TableName"
Javascript
queryAnalysis("SELECT * FROM TableName").showPlan(true)
Shell
metis query-analysis "SELECT * FROM TableName" --show-plan
execute an SQL command
- sqlQuery (string) - regular SQL query, required
Javascript
sqlCmd("SELECT * FROM table").
Shell
metis sql-cmd "SELECT * FROM table"
exits the REPL
- args (array) - the cli input, default: [], optional
prints the current configuration
prints the description of an action
- actionName (string) - the name of the action to print, required
edit/add key and value to config
- key (string) - key name, required
- value (any) - the value, can be of any type, required
exits the REPL
- exitCode (number) - the exit code that would be used when terminating the process, optional
generate a completion file for bash
- file (string) - the file out path, required
prints the description of all available functions
- category (string) - select category to show
- search (string) - fuzzy search phrase
disable printing of progress bars
set the print mode
- mode (string) - the mode, one of: [pretty, json, silent], default: "pretty", required
add metis api key
- apiKey (string) - the metis api key value, required
prints the welcome message
enables printing of progress bars
run static analysis on table
- indexName (string) - index name, required
- showQueries (boolean) - show sql queries
- severity (enum) - severity of rules to show, default: "low", values: ["critical", "high", "medium", "low", "info"]
run static analysis on table
- tableName (string) - table name, required
- showQueries (boolean) - show sql queries
- severity (enum) - severity of rules to show, default: "low", values: ["critical", "high", "medium", "low", "info"]
Last modified 4mo ago