Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

malloydata/malloy-demo-bq-cli

Repository files navigation

malloy-demo-bq-cli

This is a much-simplified demonstration of one use-case of the malloy library. In this demonstration, index.ts defines a basic CLI for running Malloy queries agains a BigQuery connection, using the local configuration.

Building

To build this library, run npm run build.

Installation

To install this CLI onto your machine, run npm run install-local.

Usage

This demo supports specifying a query string directly, using the --query option, e.g.

malloy-demo-bq-cli --query "'examples.flights' | reduce flight_count is count()"

It also supports specifying a query file to run:

malloy-demo-bq-cli --query-file 'path/to/query.malloy'

A --query or --query-file must be provided.

Optionally, a --model or --model-file may be provided as well.

malloy-demo-bq-cli --query "flights | reduce flight_count" --model "define flights is ('examples.flights' flight_count is count());"

The --query, --query-file, --model, and --model-file options may be mix-and-matched, but only the last query specified will be used, and only the last model specified will be used.

malloy-demo-bq-cli --query "flights | reduce flight_count" --model-file 'path/to/model.malloy'

About

An example Malloy command line tool.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published