ezgh warehouse query <warehouse> (-e <sql> | --file f) [--user app] [--database default] [--password-stdin] [flags]Run one SQL statement as one of the warehouse’s users and print its result. The user’s password is typed at the prompt (it isn’t shown) or, with --password-stdin, read from stdin; there is no password flag, since arguments end up in shell history. The statement comes from -e or --file.
Results stop at 10,000 rows or 16 MiB, and ezgh says so on stderr. A statement runs for at most 5 minutes; Ctrl-C cancels it. Needs warehouse.warehouses.query.
Part of ezgh warehouse.
Examples
ezgh warehouse query analytics -e 'SELECT count() FROM events.page_views'
ezgh secrets read sec_… --field password --format raw | ezgh warehouse query analytics --password-stdin --file report.sql -o jsonFlags
| Flag | Type | Default | Description |
|---|---|---|---|
--database |
string | default |
the database it runs in |
-e, --execute |
string | the SQL statement | |
--file |
string | a file holding the SQL statement | |
--password-stdin |
boolean | read the user’s password from stdin | |
--user |
string | app |
the warehouse user to run it as |
This command also takes the global flags.