Back to Materialize

mz sql

doc/user/content/integrations/cli/reference/sql.md

123766 B
Original Source

The mz sql command executes SQL statements in a region.

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

Arguments

ArgumentEnvironment variablesDescription
--region=<REGION>MZ_REGIONUse the specified region.
--profile=<PROFILE>MZ_PROFILEUse the specified authentication profile.

Examples

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

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

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

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

Global flags

{{% cli-global-args %}}