Neon-CLI is a Rust Crate providing the binary for a command line interface to the Neon Serverless Postgres database.
Using the CLI is based on commands. Use 'neon-cli' and pass it a command (query, projects, keys, etc) to direct aspect of Neon. Each command takes a varying set of arguments. ```console % neon-cli Neon Postgres Database CLI
Usage: neon-cli [OPTIONS]
Commands: query Execute a query projects Get information about projects in Neon. keys Get information about keys in Neon. branch Get information about branches in Neon. endpoints Get information about endpoints in Neon. operations Get information about operations in Neon. consumption Get information about consumption in Neon. import Import data from csv file (TEXT only for now). help Print this message or the help of the given subcommand(s)
Options:
-d, --debug...
-h, --help Print help
```
Here is an example of the arguments for a given command (query, in this case using --sql or -s to pass a sql statement in.): ```console % neon-cli query --help Execute a query
Usage: neon-cli query --sql
Options:
-s, --sql
-h, --help Print help
```
Here is an example of actually using an argument for a given command. Note that "--sql=...." can also be used as -s "select * from ...."
console
% neon-cli query --sql="select * from foo limit 2;"
Executing query: select * from foo limit 2;
╭──────┬───────┬────────╮
│ bar ┆ baz ┆ counts │
╞══════╪═══════╪════════╡
│ test ┆ test2 ┆ 42 │
├╌╌╌╌╌╌┼╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌┤
│ test ┆ test2 ┆ 42 │
╰──────┴───────┴────────╯
To import a CSV file, use: ```console
% neon-cli import --help Import data from csv file (TEXT only for now).
Usage: neon-cli import [OPTIONS] --table