mz sql

The mz sql command executes SQL statements in a region.

mz sql [options...] [-- psql options...]

Arguments

Argument Environment variables Description
--region=<REGION> MZ_REGION Use the specified region.
--profile=<PROFILE> MZ_PROFILE Use the specified authentication profile.

Examples

Launch a SQL shell against the aws/us-east-1 region:

mz sql --region=aws/us-east-1

Execute a single SQL query against the default region for the profile:

mz sql -- -c "SELECT * FROM mz_sources"

Global flags

Argument Environment variables Description
‑‑config MZ_CONFIG Set the configuration file.
Default: $HOME/.config/materialize/mz.toml.
‑f, ‑‑format MZ_FORMAT Set the output format: text , json, or csv.
Default: text.
‑‑no‑color NO_COLOR, MZ_NO_COLOR Disable color output.
‑‑help Display help and exit.
‑‑version Display version and exit.
Back to top ↑