# ~/.tusk/config.toml
default = "local"
[[connection]]
name = "local"
user = "postgres"
password = "password"
host = "locahost"
port = 5432
database = "test"Each subcommand comes with a -h flag.
❯ tusk -h
Postgres tuning and utility cli
Usage: tusk [OPTIONS] <COMMAND>
Commands:
ls
query
help Print this message or the help of the given subcommand(s)
Options:
-p, --profile <PROFILE>
-h, --help Print help
-V, --version Print version
❯ tusk query -h
Usage: tusk query [OPTIONS] <COMMAND>
Commands:
older-than
kill
help Print this message or the help of the given subcommand(s)
Options:
-o, --output <OUTPUT> [default: table] [possible values: json, table, yaml]
-h, --help Print helpCheck for long running queries
❯ tusk query older-than 5min
+--------+-------------------------+-----------------------------------------------+-------+
| pid | duration | query | state |
+--------+-------------------------+-----------------------------------------------+-------+
| 118207 | 39 days 10:42:24.541683 | SELECT pg_catalog.pg_postmaster_start_time... | idle |
+--------+-------------------------+-----------------------------------------------+-------+Optionally, output as json...
❯ tusk query older-than 5min -o json | jq[
{
"pid": 118207,
"duration": "39 days 10:44:54.355862",
"query": "SELECT pg_catalog.pg_postmaster_start_time...",
"state": "idle"
}
]or yaml...
❯ tusk query older-than 5min -o yaml | yq- pid: 57114
duration: 39 days 10:45:35.301343
query: SELECT pg_catalog.pg_postmaster_start_time...
state: idleThese will output the entire query field. They have been truncated in the example for readability.