Skip to content

Releases

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 08 Nov 20:27
77635fe

fsq is a command line client for Google Firestore, built on the firestore crate: a SQL REPL with tables, query plans and index statements, and a scripting mode with JSON output. SQL needs a database of the Firestore Enterprise edition; \l, \d, SHOW INDEXES and the index commands work on both editions.

  • SQL REPL with highlighting, completion of collections and fields, statements across several lines and a history. Results are shown as tables, \x expands each document into a block, and \x full shows the path, type and whole value of every field, as \x full N does for one row;
  • EXPLAIN and EXPLAIN ANALYZE draw the query plan as a tree and warn when a query reads every document of the collection;
  • CREATE INDEX, DROP INDEX, ALTER COLLECTION and SHOW INDEXES, waiting for an index build with a spinner;
  • fsq index plan, sync, export, list, create and delete work on a firestore.indexes.json, the file of the Firebase CLI. plan shows what a sync would change, and --prune removes what the file does not declare;
  • fsq codegen and \gen show the code of the fluent API of the firestore crate for a SELECT, with a row struct typed from sample rows;
  • \l lists the collections, and \d lists the field paths of a collection with their types, how often they are present and an example value;
  • Export and import of documents as JSON lines, in an encoding that reads back to the same Firestore types;
  • Scripting with -e and -f, and --format json or jsonl output for other tools.

Install on macOS, Linux and FreeBSD:

curl -fsSL https://raw.githubusercontent.com/abdolence/firestore-cli-rs/master/install.sh | sh

On Windows (PowerShell):

irm https://raw.githubusercontent.com/abdolence/firestore-cli-rs/master/install.ps1 | iex

Or from crates.io, which installs the binary fsq:

cargo install firestore-cli

The archives below are built for macOS, Linux (glibc on x86_64 and aarch64, static musl on arm), FreeBSD and Windows. The scripts verify each against the SHA-256 digest GitHub records for it.

Connect with fsq -p my-project -d my-database. fsq uses Application Default Credentials, so run gcloud auth application-default login first. See the README for the rest.

Full Changelog: https://github.com/abdolence/firestore-cli-rs/commits/v0.1.1