ficli

command module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 15 Imported by: 0

README

ficli: a Firestore command-line tool

Installation

go install github.com/jba/ficli@latest

Documentation

Overview

ficli is a simple command-line client for Google Cloud Firestore. It lets you get, set and delete documents from the command line.

You must provide a -project flag, or set the environment variable FICLI_PROJECT.

Run with -h for documentation on the get, set, delete and docs commands. The select command is documented below.

Select

ficli has a parser for a simplified SQL-like query language. The sub-command "select" and the arguments following it are parsed into a Firestore query and executed.

The smallest query is

select FIELDS from COLLECTION

where FIELDS is a comma-separated list of fields or "*" (which can also be written "all" to avoid shell glob expansion).

To the basic query can be appended one or more "where" clauses joined by "and", an "order by" clause, and a "limit" clause. Each "where" expression is of the form

FIELD OP VALUE

where FIELD is a field name, OP is one of ==, >, >=, < or <=, and VALUE can be a number or string.

Example:

ficli select StartedAt, NumProcessed from Namespaces/dev/Updates order by StartedAt desc

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL