name: "cargo-pgx"
about: Creates and installs pgx based Postgres extensions
bin_name: "cargo"
subcommands:
- pgx:
subcommands:
- init:
about: initize pgx development environment for the first time
args:
- pg10:
long: pg10
value_name: PG10_PG_CONFIG
takes_value: true
required: false
help: if installed locally, the path to PG10's 'pg_config' tool, or 'download' to have pgx download/compile/install it
- pg11:
long: pg11
value_name: PG11_PG_CONFIG
takes_value: true
required: false
help: if installed locally, the path to PG11's 'pg_config' tool, or 'download' to have pgx download/compile/install it
- pg12:
long: pg12
value_name: PG12_PG_CONFIG
takes_value: true
required: false
help: if installed locally, the path to PG12's 'pg_config' tool, or 'download' to have pgx download/compile/install it
- pg13:
long: pg13
value_name: PG13_PG_CONFIG
takes_value: true
required: false
help: if installed locally, the path to PG13's 'pg_config' tool, or 'download' to have pgx download/compile/install it
- pg14:
long: pg14
value_name: PG14_PG_CONFIG
takes_value: true
required: false
help: if installed locally, the path to PG14's 'pg_config' tool, or 'download' to have pgx download/compile/install it
- start:
about: start a pgx-managed Postgres instance
args:
- pg_version:
value_name: PG_VERSION
takes_value: true
required: true
help: the Postgres version to start ('pg10', 'pg11', 'pg12', 'pg13', 'pg14', or 'all')
- stop:
about: stop a pgx-managed Postgres instance
args:
- pg_version:
value_name: PG_VERSION
takes_value: true
required: true
help: the Postgres version to stop ('pg10', 'pg11', 'pg12', 'pg13', 'pg14', or 'all')
- status:
about: is a pgx-managed Postgres instance running?
args:
- pg_version:
value_name: PG_VERSION
takes_value: true
help: the Postgres version
- new:
about: create a new extension crate
args:
- name:
value_name: NAME
takes_value: true
required: true
help: the name of the extension
- bgworker:
short: bgw
long: bgworker
help: create a background worker template
- install:
about: install the extension from the current crate to the Postgres specified by whatever "pg_config" is currently on your $PATH
args:
- release:
short: r
long: release
help: compile for release mode (default is debug)
- pg_config:
short: c
long: pg_config
takes_value: true
help: the `pg_config` path (default is first in $PATH)
- features:
long: features
help: additional cargo features to activate (default is '--no-default-features')
takes_value: true
multiple: true
- package:
about: create an installation package directory (in ./target/[debug|release]/extname-pgXX/).
args:
- debug:
short: d
long: debug
help: compile for debug mode (default is release)
- pg_config:
short: c
long: pg_config
takes_value: true
help: the `pg_config` path (default is first in $PATH)
- features:
long: features
help: additional cargo features to activate (default is '--no-default-features')
takes_value: true
multiple: true
- schema:
about: generate extension schema files
after_help: |
REQUIREMENTS
The SQL generation process requires configuring a few settings in the crate. Normally 'cargo pgx schema --force-default'
can set these automatically.
They are documented in the README.md of cargo-pgx: https://github.com/zombodb/pgx/tree/master/cargo-pgx#Manual-SQL-Generation
args:
- manual:
short: m
long: manual
help: Skip checking for required files
- force-default:
short: f
long: force-default
help: Force the generation of default required files
- pg_version:
value_name: PG_VERSION
takes_value: true
required: false
help: Do you want to run against Postgres 'pg10', 'pg11', 'pg12', 'pg13', 'pg14'?
- release:
short: r
long: release
help: Compile for release mode (default is debug)
- pg_config:
short: c
long: pg_config
takes_value: true
help: the `pg_config` path (default is first in $PATH)
- features:
long: features
help: additional cargo features to activate (default is none)
takes_value: true
multiple: true
- out:
long: out
short: o
help: A path to output a produced SQL file (default is `sql/$EXTNAME-$VERSION.sql`)
takes_value: true
- dot:
long: dot
short: d
help: A path to output a produced GraphViz DOT file
takes_value: true
default_value: extension.dot
- verbose:
long: verbose
short: v
multiple: true
help: Enable debug logging (-vv for trace)
- run:
about: compile/install extension to a pgx-managed Postgres instance and start psql
args:
- pg_version:
value_name: PG_VERSION
takes_value: true
required: true
help: Do you want to run against Postgres 'pg10', 'pg11', 'pg12', 'pg13', 'pg14'?
- dbname:
value_name: DBNAME
takes_value: true
help: The database to connect to (and create if the first time). Defaults to a database with the same name as the current extension name
- release:
short: r
long: release
help: compile for release mode (default is debug)
- features:
long: features
help: additional cargo features to activate (default is '--no-default-features')
takes_value: true
multiple: true
- connect:
about: connect, via psql, to a Postgres instance
args:
- pg_version:
value_name: PG_VERSION
takes_value: true
required: true
help: Do you want to run against Postgres 'pg10', 'pg11', 'pg12', 'pg13', 'pg14'?
- dbname:
value_name: DBNAME
takes_value: true
help: The database to connect to (and create if the first time). Defaults to a database with the same name as the current extension name
- test:
about: run the test suite for this crate
args:
- pg_version:
value_name: PG_VERSION
takes_value: true
help: Do you want to test for Postgres 'pg10', 'pg11', 'pg12', 'pg13', 'pg14', or 'all' (default)?
- testname:
value_name: TESTNAME
takes_value: true
help: If specified, only run tests containing this string in their names
- release:
short: r
long: release
help: compile for release mode (default is debug)
- workspace:
long: workspace
help: Test all packages in the workspace
- features:
long: features
help: additional cargo features to activate (default is '--no-default-features')
takes_value: true
multiple: true
- get:
about: get a property from the extension control file
args:
- name:
value_name: PROPERTY_NAME
takes_value: true
required: true
help: one of the properties from extension.control