id = "postgresql"
name = "PostgreSQL"
homepage = "https://www.postgresql.org"
description = "The world's most advanced open source relational database."
icon = "theSVG:postgresql"
executables = [
"psql",
"pg_dump",
"pg_dumpall",
"pg_restore",
"pg_isready",
"pgbench",
"createdb",
"dropdb",
]
[dotfiles]
paths = [
"~/.psqlrc",
"~/.psqlrc-*",
"%APPDATA%/postgresql/psqlrc.conf",
"~/.pg_service.conf",
"%APPDATA%/postgresql/.pg_service.conf",
]
exclude = [
"~/.psql_history",
"%APPDATA%/postgresql/psql_history",
]
secret = [
"~/.pgpass",
"%APPDATA%/postgresql/pgpass.conf",
]
side_effect = false
[commands]
format = 1
label = "psql session"
description = "Connect with psql and optionally run a command or script file. The other PostgreSQL tools (pg_dump, pg_restore, createdb and so on) are not covered, and passwords are left to the prompt."
quality = "ai-draft"
base = "fig:psql"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = true, short_bundles = true }
[[commands.source]]
id = "fig"
kind = "completion"
url = "https://github.com/withfig/autocomplete/blob/master/src/psql.ts"
license = "MIT"
[[commands.field]]
id = "host"
label = "Host"
type = "string"
option = ["--host", "-h"]
sources = ["fig"]
[[commands.field]]
id = "port"
label = "Port"
type = "integer"
option = ["--port", "-p"]
sources = ["fig"]
[[commands.field]]
id = "username"
label = "Username"
type = "string"
option = ["--username", "-U"]
sources = ["fig"]
[[commands.field]]
id = "dbname"
label = "Database"
type = "string"
option = ["--dbname", "-d"]
sources = ["fig"]
[[commands.field]]
id = "command"
label = "SQL command"
type = "string"
option = ["--command", "-c"]
multiple = true
sources = ["fig"]
[[commands.field]]
id = "file"
label = "Script file"
type = "path"
option = ["--file", "-f"]
path = { kind = "file", role = "input" }
sources = ["fig"]
[[commands.field]]
id = "list"
label = "List databases"
type = "boolean"
option = ["--list", "-l"]
sources = ["fig"]
[[commands.field]]
id = "tuples_only"
label = "Tuples only"
type = "boolean"
option = ["--tuples-only", "-t"]
sources = ["fig"]
[[commands.field]]
id = "no_align"
label = "Unaligned output"
type = "boolean"
option = ["--no-align", "-A"]
sources = ["fig"]
[[commands.field]]
id = "csv"
label = "CSV output"
type = "boolean"
option = ["--csv"]
sources = ["fig"]
[[commands.field]]
id = "expanded"
label = "Expanded output"
type = "boolean"
option = ["--expanded", "-x"]
sources = ["fig"]
[[commands.field]]
id = "quiet"
label = "Quiet"
type = "boolean"
option = ["--quiet", "-q"]
sources = ["fig"]
[[commands.field]]
id = "no_psqlrc"
label = "Ignore psqlrc"
type = "boolean"
option = ["--no-psqlrc", "-X"]
sources = ["fig"]
[[commands.field]]
id = "single_transaction"
label = "Single transaction"
type = "boolean"
option = ["--single-transaction", "-1"]
sources = ["fig"]
[[commands.field]]
id = "no_password"
label = "Never prompt for password"
type = "boolean"
option = ["--no-password", "-w"]
sources = ["fig"]
[[commands.task]]
id = "connect"
label = "Connect"
fields = ["host", "port", "username", "dbname"]
required = ["dbname"]
[[commands.task]]
id = "query"
label = "Run a query"
fields = ["host", "port", "username", "dbname", "command", "csv", "tuples_only"]
required = ["dbname", "command"]
[[commands.task]]
id = "script"
label = "Run a script"
fields = ["host", "port", "username", "dbname", "file", "single_transaction"]
required = ["dbname", "file"]
[[commands.group]]
id = "basic"
label = "Basic"
fields = ["host", "port", "username", "dbname", "command"]
[[commands.group]]
id = "advanced"
label = "Advanced"
fields = ["file", "list", "tuples_only", "no_align", "csv", "expanded", "quiet", "no_psqlrc", "single_transaction", "no_password"]