{
  "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
    },
    "source": [
      {
        "id": "fig",
        "kind": "completion",
        "url": "https://github.com/withfig/autocomplete/blob/master/src/psql.ts",
        "license": "MIT"
      }
    ],
    "field": [
      {
        "id": "host",
        "label": "Host",
        "type": "string",
        "option": [
          "--host",
          "-h"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "port",
        "label": "Port",
        "type": "integer",
        "option": [
          "--port",
          "-p"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "username",
        "label": "Username",
        "type": "string",
        "option": [
          "--username",
          "-U"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "dbname",
        "label": "Database",
        "type": "string",
        "option": [
          "--dbname",
          "-d"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "command",
        "label": "SQL command",
        "type": "string",
        "option": [
          "--command",
          "-c"
        ],
        "multiple": true,
        "sources": [
          "fig"
        ]
      },
      {
        "id": "file",
        "label": "Script file",
        "type": "path",
        "option": [
          "--file",
          "-f"
        ],
        "path": {
          "kind": "file",
          "role": "input"
        },
        "sources": [
          "fig"
        ]
      },
      {
        "id": "list",
        "label": "List databases",
        "type": "boolean",
        "option": [
          "--list",
          "-l"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "tuples_only",
        "label": "Tuples only",
        "type": "boolean",
        "option": [
          "--tuples-only",
          "-t"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_align",
        "label": "Unaligned output",
        "type": "boolean",
        "option": [
          "--no-align",
          "-A"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "csv",
        "label": "CSV output",
        "type": "boolean",
        "option": [
          "--csv"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "expanded",
        "label": "Expanded output",
        "type": "boolean",
        "option": [
          "--expanded",
          "-x"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "quiet",
        "label": "Quiet",
        "type": "boolean",
        "option": [
          "--quiet",
          "-q"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_psqlrc",
        "label": "Ignore psqlrc",
        "type": "boolean",
        "option": [
          "--no-psqlrc",
          "-X"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "single_transaction",
        "label": "Single transaction",
        "type": "boolean",
        "option": [
          "--single-transaction",
          "-1"
        ],
        "sources": [
          "fig"
        ]
      },
      {
        "id": "no_password",
        "label": "Never prompt for password",
        "type": "boolean",
        "option": [
          "--no-password",
          "-w"
        ],
        "sources": [
          "fig"
        ]
      }
    ],
    "task": [
      {
        "id": "connect",
        "label": "Connect",
        "fields": [
          "host",
          "port",
          "username",
          "dbname"
        ],
        "required": [
          "dbname"
        ]
      },
      {
        "id": "query",
        "label": "Run a query",
        "fields": [
          "host",
          "port",
          "username",
          "dbname",
          "command",
          "csv",
          "tuples_only"
        ],
        "required": [
          "dbname",
          "command"
        ]
      },
      {
        "id": "script",
        "label": "Run a script",
        "fields": [
          "host",
          "port",
          "username",
          "dbname",
          "file",
          "single_transaction"
        ],
        "required": [
          "dbname",
          "file"
        ]
      }
    ],
    "group": [
      {
        "id": "basic",
        "label": "Basic",
        "fields": [
          "host",
          "port",
          "username",
          "dbname",
          "command"
        ]
      },
      {
        "id": "advanced",
        "label": "Advanced",
        "fields": [
          "file",
          "list",
          "tuples_only",
          "no_align",
          "csv",
          "expanded",
          "quiet",
          "no_psqlrc",
          "single_transaction",
          "no_password"
        ]
      }
    ]
  }
}
