fauna-shell
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -44,5 +44,3 @@ "use strict"; | ||
}; | ||
AddEnvironmentCommand.description = `Add a new environment to \`.fauna-project\`. | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
AddEnvironmentCommand.description = `Add a new environment to \`.fauna-project\`.`; | ||
AddEnvironmentCommand.examples = [ | ||
@@ -49,0 +47,0 @@ "$ fauna environment add", |
@@ -30,6 +30,4 @@ "use strict"; | ||
ListEnvironmentCommand.flags = {}; | ||
ListEnvironmentCommand.description = `List environments available in \`.fauna-project\`. | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
ListEnvironmentCommand.description = `List environments available in \`.fauna-project\`.`; | ||
ListEnvironmentCommand.examples = ["$ fauna environment list"]; | ||
exports.default = ListEnvironmentCommand; |
@@ -29,6 +29,4 @@ "use strict"; | ||
}; | ||
SelectEnvironmentCommand.description = `Update the default environment in \`.fauna-project\`. | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
SelectEnvironmentCommand.description = `Update the default environment in \`.fauna-project\`.`; | ||
SelectEnvironmentCommand.examples = ["$ fauna environment select my-environment"]; | ||
exports.default = SelectEnvironmentCommand; |
@@ -80,5 +80,3 @@ "use strict"; | ||
}; | ||
ProjectInitCommand.description = `Initialize a project directory by generating a .fauna-project file. | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
ProjectInitCommand.description = `Initialize a project directory by generating a .fauna-project file.`; | ||
ProjectInitCommand.examples = [ | ||
@@ -85,0 +83,0 @@ "$ fauna project init", |
@@ -20,15 +20,5 @@ "use strict"; | ||
nonBetaTopics.sort((t1, t2) => t1.name.localeCompare(t2.name)); | ||
const betaTopicsSorted = []; | ||
const projectTopic = betaTopics.find((t) => t.name === "project"); | ||
if (projectTopic !== undefined) { | ||
betaTopicsSorted.push(projectTopic); | ||
} | ||
const environmentTopic = betaTopics.find((t) => t.name === "environment"); | ||
if (environmentTopic !== undefined) { | ||
betaTopicsSorted.push(environmentTopic); | ||
} | ||
betaTopicsSorted.push(...betaTopics.filter((t) => t.name !== "project" && t.name !== "environment")); | ||
return [...nonBetaTopics, ...betaTopicsSorted]; | ||
return [...nonBetaTopics, ...betaTopics]; | ||
} | ||
} | ||
exports.default = CustomHelp; |
{ | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"commands": { | ||
@@ -1354,3 +1354,3 @@ "cloud-login": { | ||
"id": "environment:add", | ||
"description": "Add a new environment to `.fauna-project`.\n\nNOTE: `fauna project` and `fauna environment` are still in beta. Behavior is subject to change.", | ||
"description": "Add a new environment to `.fauna-project`.", | ||
"strict": true, | ||
@@ -1407,3 +1407,3 @@ "pluginName": "fauna-shell", | ||
"id": "environment:list", | ||
"description": "List environments available in `.fauna-project`.\n\nNOTE: `fauna project` and `fauna environment` are still in beta. Behavior is subject to change.", | ||
"description": "List environments available in `.fauna-project`.", | ||
"strict": true, | ||
@@ -1422,3 +1422,3 @@ "pluginName": "fauna-shell", | ||
"id": "environment:select", | ||
"description": "Update the default environment in `.fauna-project`.\n\nNOTE: `fauna project` and `fauna environment` are still in beta. Behavior is subject to change.", | ||
"description": "Update the default environment in `.fauna-project`.", | ||
"strict": true, | ||
@@ -1443,3 +1443,3 @@ "pluginName": "fauna-shell", | ||
"id": "project:init", | ||
"description": "Initialize a project directory by generating a .fauna-project file.\n\nNOTE: `fauna project` and `fauna environment` are still in beta. Behavior is subject to change.", | ||
"description": "Initialize a project directory by generating a .fauna-project file.", | ||
"strict": true, | ||
@@ -1446,0 +1446,0 @@ "pluginName": "fauna-shell", |
{ | ||
"name": "fauna-shell", | ||
"description": "faunadb shell", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"author": "Fauna", | ||
@@ -95,9 +95,9 @@ "bin": { | ||
"schema": { | ||
"description": "Manage database schema" | ||
"description": "Manage database schema." | ||
}, | ||
"project": { | ||
"description": "[BETA] Manage project settings in .fauna-project.\nNOTE: `fauna project` and `fauna environment` are still in beta. Behavior is subject to change." | ||
"description": "Manage project settings in .fauna-project." | ||
}, | ||
"environment": { | ||
"description": "[BETA] Manage environments in the current project.\nNOTE: `fauna project` and `fauna environment` are still in beta. Behavior is subject to change." | ||
"description": "Manage environments in the current project." | ||
} | ||
@@ -104,0 +104,0 @@ } |
687
README.md
@@ -21,12 +21,19 @@ # Fauna CLI | ||
<!-- toc --> | ||
You can upgrade like this: | ||
- [Usage](#usage) | ||
- [Technical Requirements](#technical-requirements) | ||
- [Shell](#shell) | ||
- [Connecting to different endpoints](#connecting-to-different-endpoints) | ||
- [Overriding Connection Parameters](#overriding-connection-parameters) | ||
- [Executing queries from a file](#executing-queries-from-a-file) | ||
- [List of Commands](#list-of-commands) | ||
``` | ||
$ npm update -g fauna-shell | ||
``` | ||
<!-- toc --> | ||
* [Fauna CLI](#fauna-cli) | ||
* [Usage](#usage) | ||
* [Technical Requirements](#technical-requirements) | ||
* [Shell](#shell) | ||
* [Connecting to different endpoints](#connecting-to-different-endpoints) | ||
* [Connecting to local endpoints](#connecting-to-local-endpoints) | ||
* [Overriding Connection Parameters](#overriding-connection-parameters) | ||
* [Executing queries from a file](#executing-queries-from-a-file) | ||
* [List of Commands](#list-of-commands) | ||
* [Development](#development) | ||
<!-- tocstop --> | ||
@@ -470,28 +477,67 @@ | ||
<!-- commands --> | ||
* [`fauna add-endpoint [NAME]`](#fauna-add-endpoint-name) | ||
* [`fauna cloud-login`](#fauna-cloud-login) | ||
* [`fauna create-database DBNAME`](#fauna-create-database-dbname) | ||
* [`fauna create-key DBNAME [ROLE]`](#fauna-create-key-dbname-role) | ||
* [`fauna default-endpoint [NAME]`](#fauna-default-endpoint-name) | ||
* [`fauna delete-database DBNAME`](#fauna-delete-database-dbname) | ||
* [`fauna delete-endpoint NAME`](#fauna-delete-endpoint-name) | ||
* [`fauna delete-key KEYNAME`](#fauna-delete-key-keyname) | ||
* [`fauna endpoint add [NAME]`](#fauna-endpoint-add-name) | ||
* [`fauna endpoint list`](#fauna-endpoint-list) | ||
* [`fauna endpoint remove NAME`](#fauna-endpoint-remove-name) | ||
* [`fauna endpoint select [NAME]`](#fauna-endpoint-select-name) | ||
* [`fauna environment add`](#fauna-environment-add) | ||
* [`fauna environment list`](#fauna-environment-list) | ||
* [`fauna environment select ENVIRONMENT`](#fauna-environment-select-environment) | ||
* [`fauna eval [DBNAME] [QUERY]`](#fauna-eval-dbname-query) | ||
* [`fauna help [COMMANDS]`](#fauna-help-commands) | ||
* [`fauna import`](#fauna-import) | ||
* [`fauna list-databases`](#fauna-list-databases) | ||
* [`fauna list-endpoints`](#fauna-list-endpoints) | ||
* [`fauna list-keys`](#fauna-list-keys) | ||
* [`fauna project init [PROJECTDIR]`](#fauna-project-init-projectdir) | ||
* [`fauna run-queries [DBNAME] [QUERY]`](#fauna-run-queries-dbname-query) | ||
* [`fauna schema diff`](#fauna-schema-diff) | ||
* [`fauna schema pull`](#fauna-schema-pull) | ||
* [`fauna schema push`](#fauna-schema-push) | ||
* [`fauna shell [DB_PATH]`](#fauna-shell-db_path) | ||
* [`fauna upload-graphql-schema GRAPHQLFILEPATH`](#fauna-upload-graphql-schema-graphqlfilepath) | ||
- [`fauna cloud-login`](#fauna-cloud-login) | ||
- [`fauna create-database`](#fauna-create-database) | ||
- [`fauna create-key`](#fauna-create-key) | ||
- [`fauna delete-database`](#fauna-delete-database) | ||
- [`fauna delete-key`](#fauna-delete-key) | ||
- [`fauna endpoint`](#fauna-endpoint) | ||
- [`fauna eval`](#fauna-eval) | ||
- [`fauna help`](#fauna-help) | ||
- [`fauna import`](#fauna-import) | ||
- [`fauna list-databases`](#fauna-list-databases) | ||
- [`fauna list-keys`](#fauna-list-keys) | ||
- [`fauna project`](#fauna-project) | ||
- [`fauna schema`](#fauna-schema) | ||
- [`fauna shell`](#fauna-shell) | ||
- [`fauna environment`](#fauna-environment) | ||
- [`fauna upload-graphql-schema`](#fauna-upload-graphql-schema) | ||
## `fauna add-endpoint [NAME]` | ||
Add an endpoint to ~/.fauna-shell. | ||
``` | ||
USAGE | ||
$ fauna add-endpoint [NAME] [--non-interactive --url <value> --secret <value>] [--set-default] | ||
ARGUMENTS | ||
NAME Endpoint name | ||
FLAGS | ||
--non-interactive Disables interaction | ||
--secret=<value> Database secret | ||
--set-default Sets this environment as the default | ||
--url=<value> Database URL | ||
DESCRIPTION | ||
Add an endpoint to ~/.fauna-shell. | ||
ALIASES | ||
$ fauna add-endpoint | ||
EXAMPLES | ||
$ fauna endpoint add | ||
$ fauna endpoint add localhost --url http://localhost:8443/ --secret secret | ||
$ fauna endpoint add localhost --set-default | ||
``` | ||
## `fauna cloud-login` | ||
Prompts the user to log into a Fauna account, and saves the secret to a new | ||
endpoint. | ||
```sh | ||
Log in to a Fauna account. | ||
``` | ||
USAGE | ||
@@ -507,17 +553,12 @@ $ fauna cloud-login | ||
## `fauna create-database` | ||
_See code: [dist/commands/cloud-login.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/cloud-login.ts)_ | ||
Create a database with the given name. | ||
## `fauna create-database DBNAME` | ||
This is the same as the following query: | ||
```ts | ||
Database.create({ name: DBNAME }) | ||
``` | ||
```sh | ||
Create a database. | ||
``` | ||
USAGE | ||
$ fauna create-database DBNAME [--url <value>] [--timeout <value>] | ||
[--secret <value>] [--endpoint <value>] [--environment <value>] | ||
$ fauna create-database DBNAME [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] | ||
[--environment <value>] | ||
@@ -541,20 +582,12 @@ ARGUMENTS | ||
## `fauna create-key` | ||
_See code: [dist/commands/create-database.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/create-database.ts)_ | ||
## `fauna create-key DBNAME [ROLE]` | ||
Create a key for the specified database. | ||
This is the same as the following query: | ||
```ts | ||
Key.create({ | ||
database: DBNAME, | ||
role: ROLE | ||
}) | ||
``` | ||
```sh | ||
Create a key for the specified database. | ||
USAGE | ||
$ fauna create-key DBNAME [ROLE] [--url <value>] [--timeout <value>] | ||
[--secret <value>] [--endpoint <value>] [--environment <value>] | ||
$ fauna create-key DBNAME [ROLE] [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] | ||
[--environment <value>] | ||
@@ -579,17 +612,35 @@ ARGUMENTS | ||
## `fauna delete-database` | ||
_See code: [dist/commands/create-key.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/create-key.ts)_ | ||
Delete the given database. Warning: this action cannot be undone. | ||
## `fauna default-endpoint [NAME]` | ||
This is the same as the following query: | ||
```ts | ||
Database.byName(DBNAME)!.delete() | ||
Set an endpoint as the default one. | ||
``` | ||
USAGE | ||
$ fauna default-endpoint [NAME] | ||
```sh | ||
ARGUMENTS | ||
NAME New default endpoint | ||
DESCRIPTION | ||
Set an endpoint as the default one. | ||
ALIASES | ||
$ fauna default-endpoint | ||
EXAMPLES | ||
$ fauna endpoint select | ||
$ fauna endpoint select endpoint | ||
``` | ||
## `fauna delete-database DBNAME` | ||
Delete a database. | ||
``` | ||
USAGE | ||
$ fauna delete-database DBNAME [--url <value>] [--timeout <value>] | ||
[--secret <value>] [--endpoint <value>] [--environment <value>] | ||
$ fauna delete-database DBNAME [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] | ||
[--environment <value>] | ||
@@ -613,17 +664,33 @@ ARGUMENTS | ||
## `fauna delete-key` | ||
_See code: [dist/commands/delete-database.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/delete-database.ts)_ | ||
Delete a key with the given ID. | ||
## `fauna delete-endpoint NAME` | ||
This is the same as the following query: | ||
```ts | ||
Key.byId(ID)!.delete() | ||
Remove an endpoint from ~/.fauna-shell. | ||
``` | ||
USAGE | ||
$ fauna delete-endpoint NAME | ||
```sh | ||
ARGUMENTS | ||
NAME Endpoint name | ||
DESCRIPTION | ||
Remove an endpoint from ~/.fauna-shell. | ||
ALIASES | ||
$ fauna delete-endpoint | ||
EXAMPLES | ||
$ fauna endpoint remove my_endpoint | ||
``` | ||
## `fauna delete-key KEYNAME` | ||
Delete a key. | ||
``` | ||
USAGE | ||
$ fauna delete-key KEYNAME [--url <value>] [--timeout <value>] | ||
[--secret <value>] [--endpoint <value>] [--environment <value>] | ||
$ fauna delete-key KEYNAME [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] | ||
[--environment <value>] | ||
@@ -647,23 +714,11 @@ ARGUMENTS | ||
## `fauna endpoint` | ||
_See code: [dist/commands/delete-key.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/delete-key.ts)_ | ||
Commands to manage endpoints in ~/.fauna-shell. | ||
## `fauna endpoint add [NAME]` | ||
### `fauna endpoint add` | ||
Add a new endpoint to ~/.fauna-shell. All flags are optional, and the user will | ||
be prompted to fill in any missing values that are needed. | ||
This command is intended for custom Fauna endpoints. If you are connecting to | ||
a database in the dashboard, prefer `fauna cloud-login` instead. | ||
If `--non-interactive` is set, no prompts will be shown, and the `--url` and | ||
`--secret` flags will be required. | ||
```sh | ||
Add an endpoint to ~/.fauna-shell. | ||
``` | ||
USAGE | ||
$ fauna endpoint add [NAME] [--non-interactive --url <value> --secret | ||
<value>] [--set-default] | ||
$ fauna endpoint add [NAME] [--non-interactive --url <value> --secret <value>] [--set-default] | ||
@@ -693,9 +748,7 @@ ARGUMENTS | ||
### `fauna endpoint list` | ||
## `fauna endpoint list` | ||
List endpoints from ~/.fauna-shell. | ||
```sh | ||
List endpoints in ~/.fauna-shell. | ||
``` | ||
USAGE | ||
@@ -714,9 +767,7 @@ $ fauna endpoint list | ||
### `fauna endpoint remove` | ||
## `fauna endpoint remove NAME` | ||
Remove an endpoint from ~/.fauna-shell. | ||
```sh | ||
Remove an endpoint from ~/.fauna-shell. | ||
``` | ||
USAGE | ||
@@ -738,9 +789,7 @@ $ fauna endpoint remove NAME | ||
### `fauna endpoint select` | ||
## `fauna endpoint select [NAME]` | ||
Set an endpoint as the default one. | ||
```sh | ||
Set an endpoint as the default one. | ||
``` | ||
USAGE | ||
@@ -764,23 +813,70 @@ $ fauna endpoint select [NAME] | ||
## `fauna eval` | ||
## `fauna environment add` | ||
Evaluate the given query. | ||
Add a new environment to `.fauna-project`. | ||
The `--file` option can be used to read a file instead of using the command | ||
argument as the query. | ||
``` | ||
USAGE | ||
$ fauna environment add [--non-interactive --name <value> --endpoint <value> --database <value>] [--set-default] | ||
The `--output` option can be used to write the query output to a file instead | ||
of stdout. | ||
FLAGS | ||
--database=<value> Database path to use in this environment | ||
--endpoint=<value> Endpoint to use in this environment | ||
--name=<value> New environment name | ||
--non-interactive Disable interaction | ||
--set-default Set this environment as the default | ||
The `--stdin` option can be used to read a query from stdin instead of command | ||
line arguments. | ||
DESCRIPTION | ||
Add a new environment to `.fauna-project`. | ||
```sh | ||
EXAMPLES | ||
$ fauna environment add | ||
$ fauna environment add --name my-app --endpoint dev --database my-database | ||
$ fauna environment add --name my-app --endpoint dev --database my-database --set-default | ||
``` | ||
## `fauna environment list` | ||
List environments available in `.fauna-project`. | ||
``` | ||
USAGE | ||
$ fauna environment list | ||
DESCRIPTION | ||
List environments available in `.fauna-project`. | ||
EXAMPLES | ||
$ fauna environment list | ||
``` | ||
## `fauna environment select ENVIRONMENT` | ||
Update the default environment in `.fauna-project`. | ||
``` | ||
USAGE | ||
$ fauna environment select ENVIRONMENT | ||
ARGUMENTS | ||
ENVIRONMENT The new default environment to use | ||
DESCRIPTION | ||
Update the default environment in `.fauna-project`. | ||
EXAMPLES | ||
$ fauna environment select my-environment | ||
``` | ||
## `fauna eval [DBNAME] [QUERY]` | ||
Evaluate the given query. | ||
``` | ||
USAGE | ||
$ fauna eval [DBNAME] [QUERY] [--url <value>] [--timeout | ||
<value>] [--secret <value>] [--endpoint <value>] [--environment <value>] | ||
[--file <value>] [--stdin] [--output <value>] [--format | ||
json|json-tagged|shell] [--version 4|10] [--typecheck] | ||
$ fauna eval [DBNAME] [QUERY] [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint | ||
<value>] [--environment <value>] [--file <value>] [--stdin] [--output <value>] [--format json|json-tagged|shell] | ||
[--version 4|10] [--typecheck] | ||
@@ -823,39 +919,24 @@ ARGUMENTS | ||
## `fauna help` | ||
_See code: [dist/commands/eval.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/eval.ts)_ | ||
Shows help for the Fauna CLI. | ||
## `fauna help [COMMANDS]` | ||
```sh | ||
faunadb shell | ||
Display help for fauna. | ||
``` | ||
USAGE | ||
$ fauna [COMMAND] | ||
$ fauna help [COMMANDS] [-n] | ||
TOPICS | ||
endpoint Manage endpoints in ~/.fauna-shell. | ||
schema Manage database schema | ||
project [BETA] Manage project settings in .fauna-project. | ||
environment [BETA] Manage environments in the current project. | ||
ARGUMENTS | ||
COMMANDS Command to show help for. | ||
COMMANDS | ||
add-endpoint Add an endpoint to ~/.fauna-shell. | ||
cloud-login Log in to a Fauna account. | ||
create-database Create a database. | ||
create-key Create a key for the specified database. | ||
default-endpoint Set an endpoint as the default one. | ||
delete-database Delete a database. | ||
delete-endpoint Remove an endpoint from ~/.fauna-shell. | ||
delete-key Delete a key. | ||
eval Evaluate the given query. | ||
help Display help for fauna. | ||
import Import data to Fauna. | ||
list-databases List child databases in the current database. | ||
list-endpoints List endpoints in ~/.fauna-shell. | ||
list-keys List keys in the current database. | ||
run-queries Run the queries found on the file passed to the | ||
command. | ||
shell Start an interactive shell. | ||
upload-graphql-schema Upload GraphQL schema. | ||
FLAGS | ||
-n, --nested-commands Include all nested commands in the output. | ||
DESCRIPTION | ||
Display help for fauna. | ||
``` | ||
_See code: [dist/commands/help.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/help.ts)_ | ||
## `fauna import` | ||
@@ -865,10 +946,7 @@ | ||
```sh | ||
Import data to Fauna. | ||
``` | ||
USAGE | ||
$ fauna import --path <value> [--url <value>] [--timeout <value>] | ||
[--secret <value>] [--endpoint <value>] [--environment <value>] [--db | ||
<value>] [--collection <value>] [--type <value>] [--append] | ||
[--allow-short-rows] [--dry-run] [--treat-empty-csv-cells-as empty|null] | ||
$ fauna import --path <value> [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] | ||
[--environment <value>] [--db <value>] [--collection <value>] [--type <value>] [--append] [--allow-short-rows] | ||
[--dry-run] [--treat-empty-csv-cells-as empty|null] | ||
@@ -889,6 +967,4 @@ FLAGS | ||
--dry-run | ||
Dry run the import - committing no documents to Fauna but converting all | ||
items to Fauna's format and applying all requested --type conversions. | ||
Enables you to detect issues with your file(s) before writing to your | ||
collection(s). | ||
Dry run the import - committing no documents to Fauna but converting all items to Fauna's format and applying all | ||
requested --type conversions. Enables you to detect issues with your file(s) before writing to your collection(s). | ||
@@ -902,4 +978,4 @@ --endpoint=<value> | ||
--path=<value> | ||
(required) Path to .csv/.json file, or path to folder containing .csv/.json | ||
files. if the path is to a folder, sub-folders will be skipped. | ||
(required) Path to .csv/.json file, or path to folder containing .csv/.json files. if the path is to a folder, | ||
sub-folders will be skipped. | ||
@@ -913,10 +989,8 @@ --secret=<value> | ||
--treat-empty-csv-cells-as=<option> | ||
[default: null] Treat empty csv cells as empty strings or null, default is | ||
null. | ||
[default: null] Treat empty csv cells as empty strings or null, default is null. | ||
<options: empty|null> | ||
--type=<value>... | ||
Column type casting - converts the column value to a Fauna type. Available | ||
only in CSVs; will be ignored in json/jsonl inputs. Null values will be | ||
treated as null and no conversion will be performed. | ||
Column type casting - converts the column value to a Fauna type. Available only in CSVs; will be ignored in | ||
json/jsonl inputs. Null values will be treated as null and no conversion will be performed. | ||
Format: <column>::<type> | ||
@@ -926,6 +1000,5 @@ <column>: the name of the column to cast values | ||
'number' - convert string to number | ||
'bool' - convert 'true', 't', 'yes', or '1' to true and all other values to | ||
false (saving null which will be treated as null) | ||
'dateString' - convert a ISO-8601 or RFC-2822 date string to a Fauna Time; | ||
will make a best effort on other formats, | ||
'bool' - convert 'true', 't', 'yes', or '1' to true and all other values to false (saving null which will be treated | ||
as null) | ||
'dateString' - convert a ISO-8601 or RFC-2822 date string to a Fauna Time; will make a best effort on other formats, | ||
'dateEpochMillis' - converts milliseconds since the epoch to a Fauna Time | ||
@@ -986,17 +1059,12 @@ 'dateEpochSeconds' - converts seconds since the epoch to a Fauna Time | ||
_See code: [dist/commands/import.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/import.ts)_ | ||
## `fauna list-databases` | ||
Lists child databases in the current database. | ||
List child databases in the current database. | ||
This is the same as the following query: | ||
```ts | ||
Database.all().take(1000).toArray() | ||
``` | ||
```sh | ||
List child databases in the current database. | ||
USAGE | ||
$ fauna list-databases [--url <value>] [--timeout <value>] [--secret | ||
<value>] [--endpoint <value>] [--environment <value>] | ||
$ fauna list-databases [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] [--environment | ||
<value>] | ||
@@ -1017,17 +1085,30 @@ FLAGS | ||
## `fauna list-keys` | ||
_See code: [dist/commands/list-databases.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/list-databases.ts)_ | ||
List keys in the current database. | ||
## `fauna list-endpoints` | ||
This is the same as the following query: | ||
```ts | ||
Key.all().take(100).toArray() | ||
List endpoints in ~/.fauna-shell. | ||
``` | ||
USAGE | ||
$ fauna list-endpoints | ||
```sh | ||
DESCRIPTION | ||
List endpoints in ~/.fauna-shell. | ||
ALIASES | ||
$ fauna list-endpoints | ||
EXAMPLES | ||
$ fauna endpoint list | ||
``` | ||
## `fauna list-keys` | ||
List keys in the current database. | ||
``` | ||
USAGE | ||
$ fauna list-keys [--url <value>] [--timeout <value>] [--secret | ||
<value>] [--endpoint <value>] [--environment <value>] | ||
$ fauna list-keys [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] [--environment | ||
<value>] | ||
@@ -1048,19 +1129,9 @@ FLAGS | ||
## `fauna project` | ||
_See code: [dist/commands/list-keys.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/list-keys.ts)_ | ||
Commands to manage endpoints in ~/.fauna-shell. | ||
## `fauna project init [PROJECTDIR]` | ||
### `fauna project init` | ||
Creates a new `.fauna-project` file in the current directory. All flags are | ||
optional, and the user will be prompted to fill in any missing values that are | ||
needed. | ||
Projects represent a selected database, and store the schema files for that | ||
database. The project config, `.fauna-project`, will be read by commands such as | ||
`fauna schema pull`, and schema will be pulled into the project directory. | ||
```sh | ||
Initialize a project directory by generating a .fauna-project file. | ||
``` | ||
USAGE | ||
@@ -1070,4 +1141,3 @@ $ fauna project init [PROJECTDIR] | ||
ARGUMENTS | ||
PROJECTDIR The directory to initialize as a fauna project. If not provided | ||
will default to the current directory. | ||
PROJECTDIR The directory to initialize as a fauna project. If not provided will default to the current directory. | ||
@@ -1077,5 +1147,2 @@ DESCRIPTION | ||
NOTE: `fauna project` and `fauna environment` are still in beta. Behavior is | ||
subject to change. | ||
EXAMPLES | ||
@@ -1087,24 +1154,51 @@ $ fauna project init | ||
## `fauna schema` | ||
## `fauna run-queries [DBNAME] [QUERY]` | ||
Commands for interacting with schema (.fsl) files in a database. | ||
Run the queries found on the file passed to the command. | ||
### `fauna schema diff` | ||
``` | ||
USAGE | ||
$ fauna run-queries [DBNAME] [QUERY] --file <value> [--url <value>] [--timeout <value>] [--secret <value>] | ||
[--endpoint <value>] [--environment <value>] [--stdin] [--output <value>] [--format json|json-tagged|shell] | ||
[--version 4|10] [--typecheck] | ||
Print a diff between local schema files and Fauna schema. | ||
ARGUMENTS | ||
DBNAME Database name | ||
QUERY FQL query to execute | ||
This will search the given `DIR` recursively, and consider any files with the | ||
`.fsl` extension a schema file. It will then fetch all schema files in the | ||
database, and display a complete diff between all the files. | ||
FLAGS | ||
--endpoint=<value> Connection endpoint, from ~/.fauna-shell | ||
--environment=<value> Environment to use, from a Fauna project | ||
--file=<value> (required) File where to read queries from | ||
--format=<option> Output format | ||
<options: json|json-tagged|shell> | ||
--output=<value> File to write output to | ||
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell | ||
--stdin Read file input from stdin. Writes to stdout by default | ||
--timeout=<value> Connection timeout in milliseconds | ||
--typecheck Enable typechecking | ||
--url=<value> Database URL. Overrides the `url` in ~/.fauna-shell | ||
--version=<option> [default: 10] FQL Version | ||
<options: 4|10> | ||
```sh | ||
DESCRIPTION | ||
Run the queries found on the file passed to the command. | ||
EXAMPLES | ||
$ fauna run-queries dbname --file=/path/to/queries.fql | ||
``` | ||
_See code: [dist/commands/run-queries.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/run-queries.ts)_ | ||
## `fauna schema diff` | ||
Print the diff between local and remote schema. | ||
``` | ||
USAGE | ||
$ fauna schema diff [--url <value>] [--timeout <value>] [--secret | ||
<value>] [--endpoint <value>] [--environment <value>] [--dir <value>] | ||
$ fauna schema diff [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] [--environment | ||
<value>] [--dir <value>] | ||
FLAGS | ||
--dir=<value> The directory of .fsl files to push. Defaults to the | ||
directory of `.fauna-project` | ||
--dir=<value> The directory of .fsl files to push. Defaults to the directory of `.fauna-project` | ||
--endpoint=<value> Connection endpoint, from ~/.fauna-shell | ||
@@ -1125,32 +1219,16 @@ --environment=<value> Environment to use, from a Fauna project | ||
### `fauna schema push` | ||
## `fauna schema pull` | ||
Push local schema files to Fauna. Without `--force` set, the user must confirm a | ||
diff. | ||
Pull a database schema's .fsl files into the current project. | ||
Uploads a directory of schema files to a database. This will search the given | ||
`DIR` recursively, and consider any files with the `.fsl` extension a schema | ||
file. It will consider any files in the database that are not present locally to | ||
be deleted. So, pushing an empty directory will delete all schema from the given | ||
database. | ||
After the set of schema files are found, it will then compare them to the | ||
database's schema, and display a diff. It will then ask the user for | ||
confirmation to apply the given update. `--force` can be passed to skip this | ||
confirmation step. | ||
```sh | ||
Push the current project's .fsl files to Fauna. | ||
``` | ||
USAGE | ||
$ fauna schema push [--url <value>] [--timeout <value>] [--secret | ||
<value>] [--endpoint <value>] [--environment <value>] [--dir <value>] | ||
[--force] | ||
$ fauna schema pull [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] [--environment | ||
<value>] [--dir <value>] [--delete] | ||
FLAGS | ||
--dir=<value> The directory of .fsl files to push. Defaults to the | ||
directory of `.fauna-project` | ||
--delete Delete .fsl files in the target directory that are not part of the database schema | ||
--dir=<value> The directory of .fsl files to push. Defaults to the directory of `.fauna-project` | ||
--endpoint=<value> Connection endpoint, from ~/.fauna-shell | ||
--environment=<value> Environment to use, from a Fauna project | ||
--force Push the change without a diff or schema version check | ||
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell | ||
@@ -1161,38 +1239,22 @@ --timeout=<value> Connection timeout in milliseconds | ||
DESCRIPTION | ||
Push the current project's .fsl files to Fauna. | ||
Pull a database schema's .fsl files into the current project. | ||
EXAMPLES | ||
$ fauna schema push | ||
$ fauna schema push --dir schemas/myschema | ||
$ fauna schema pull | ||
``` | ||
### `fauna schema pull` | ||
## `fauna schema push` | ||
Pull schema from Fauna and save as local schema files. | ||
Push the current project's .fsl files to Fauna. | ||
This will download all schema files in the selected database. It will then place | ||
them in the given `DIR`. It will confirm before overwriting any existing files | ||
in `DIR`. It will also create directories for any schema files that have a `/` | ||
in their name. | ||
Any schema files not present in the database will be ignored. If the `--delete` | ||
flag is passed, then all files present locally but not in the database will be | ||
removed. | ||
```sh | ||
Pull a database schema's .fsl files into the current project. | ||
``` | ||
USAGE | ||
$ fauna schema pull [--url <value>] [--timeout <value>] [--secret | ||
<value>] [--endpoint <value>] [--environment <value>] [--dir <value>] | ||
[--delete] | ||
$ fauna schema push [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] [--environment | ||
<value>] [--dir <value>] [--force] | ||
FLAGS | ||
--delete Delete .fsl files in the target directory that are not | ||
part of the database schema | ||
--dir=<value> The directory of .fsl files to push. Defaults to the | ||
directory of `.fauna-project` | ||
--dir=<value> The directory of .fsl files to push. Defaults to the directory of `.fauna-project` | ||
--endpoint=<value> Connection endpoint, from ~/.fauna-shell | ||
--environment=<value> Environment to use, from a Fauna project | ||
--force Push the change without a diff or schema version check | ||
--secret=<value> Secret key. Overrides the `secret` in ~/.fauna-shell | ||
@@ -1203,20 +1265,19 @@ --timeout=<value> Connection timeout in milliseconds | ||
DESCRIPTION | ||
Pull a database schema's .fsl files into the current project. | ||
Push the current project's .fsl files to Fauna. | ||
EXAMPLES | ||
$ fauna schema pull | ||
$ fauna schema push | ||
$ fauna schema push --dir schemas/myschema | ||
``` | ||
## `fauna shell` | ||
## `fauna shell [DB_PATH]` | ||
Start an interactive shell. | ||
```sh | ||
Start an interactive shell. | ||
``` | ||
USAGE | ||
$ fauna shell [DB_PATH] [--url <value>] [--timeout <value>] | ||
[--secret <value>] [--endpoint <value>] [--environment <value>] [--file | ||
<value>] [--stdin] [--output <value>] [--format json|json-tagged|shell] | ||
[--version 4|10] [--typecheck] | ||
$ fauna shell [DB_PATH] [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] | ||
[--environment <value>] [--file <value>] [--stdin] [--output <value>] [--format json|json-tagged|shell] [--version | ||
4|10] [--typecheck] | ||
@@ -1250,99 +1311,14 @@ ARGUMENTS | ||
## `fauna environment` | ||
_See code: [dist/commands/shell.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/shell.ts)_ | ||
Commands to manage environments in .fauna-project. | ||
## `fauna upload-graphql-schema GRAPHQLFILEPATH` | ||
### `fauna environment add` | ||
Upload GraphQL schema. | ||
Add a new environment to .fauna-project. All flags are optional, and the user will | ||
be prompted to fill in any missing values that are needed. | ||
If `--non-interactive` is set, no prompts will be shown, and the `--url` and | ||
`--secret` flags will be required. | ||
```sh | ||
Add a new environment to `.fauna-project`. | ||
USAGE | ||
$ fauna environment add [--non-interactive --name <value> --endpoint | ||
<value> --database <value>] [--set-default] | ||
FLAGS | ||
--database=<value> Database path to use in this environment | ||
--endpoint=<value> Endpoint to use in this environment | ||
--name=<value> New environment name | ||
--non-interactive Disable interaction | ||
--set-default Set this environment as the default | ||
DESCRIPTION | ||
Add a new environment to `.fauna-project`. | ||
NOTE: `fauna project` and `fauna environment` are still in beta. Behavior is | ||
subject to change. | ||
EXAMPLES | ||
$ fauna environment add | ||
$ fauna environment add --name my-app --endpoint dev --database my-database | ||
$ fauna environment add --name my-app --endpoint dev --database my-database --set-default | ||
``` | ||
### `fauna environment list` | ||
List environments in .fauna-project. | ||
```sh | ||
List environments available in `.fauna-project`. | ||
USAGE | ||
$ fauna environment list | ||
$ fauna upload-graphql-schema GRAPHQLFILEPATH [--url <value>] [--timeout <value>] [--secret <value>] [--endpoint <value>] | ||
[--environment <value>] [--graphqlHost <value>] [--graphqlPort <value>] [--mode merge|override|replace] | ||
DESCRIPTION | ||
List environments available in `.fauna-project`. | ||
NOTE: `fauna project` and `fauna environment` are still in beta. Behavior is | ||
subject to change. | ||
EXAMPLES | ||
$ fauna environment list | ||
``` | ||
### `fauna environment select` | ||
Update the default environment in .fauna-project. | ||
```sh | ||
Update the default environment in `.fauna-project`. | ||
USAGE | ||
$ fauna environment select ENVIRONMENT | ||
ARGUMENTS | ||
ENVIRONMENT The new default environment to use | ||
DESCRIPTION | ||
Update the default environment in `.fauna-project`. | ||
NOTE: `fauna project` and `fauna environment` are still in beta. Behavior is | ||
subject to change. | ||
EXAMPLES | ||
$ fauna environment select my-environment | ||
``` | ||
## `fauna upload-graphql-schema` | ||
Upload a GraphQL schema. | ||
```sh | ||
Upload GraphQL schema. | ||
USAGE | ||
$ fauna upload-graphql-schema GRAPHQLFILEPATH [--url <value>] [--timeout <value>] | ||
[--secret <value>] [--endpoint <value>] [--environment <value>] | ||
[--graphqlHost <value>] [--graphqlPort <value>] [--mode | ||
merge|override|replace] | ||
ARGUMENTS | ||
GRAPHQLFILEPATH Path to GraphQL schema | ||
@@ -1370,2 +1346,3 @@ | ||
_See code: [dist/commands/upload-graphql-schema.ts](https://github.com/fauna/fauna-shell/blob/v1.2.1/dist/commands/upload-graphql-schema.ts)_ | ||
<!-- commandsstop --> | ||
@@ -1372,0 +1349,0 @@ |
@@ -25,6 +25,4 @@ import { Command, Flags } from "@oclif/core"; | ||
static description = `Add a new environment to \`.fauna-project\`. | ||
static description = `Add a new environment to \`.fauna-project\`.`; | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
static examples = [ | ||
@@ -31,0 +29,0 @@ "$ fauna environment add", |
@@ -8,6 +8,4 @@ import { Command } from "@oclif/core"; | ||
static description = `List environments available in \`.fauna-project\`. | ||
static description = `List environments available in \`.fauna-project\`.`; | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
static examples = ["$ fauna environment list"]; | ||
@@ -14,0 +12,0 @@ |
@@ -12,6 +12,4 @@ import { Args, Command } from "@oclif/core"; | ||
static description = `Update the default environment in \`.fauna-project\`. | ||
static description = `Update the default environment in \`.fauna-project\`.`; | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
static examples = ["$ fauna environment select my-environment"]; | ||
@@ -18,0 +16,0 @@ |
@@ -25,6 +25,4 @@ import { input } from "@inquirer/prompts"; | ||
static description = `Initialize a project directory by generating a .fauna-project file. | ||
static description = `Initialize a project directory by generating a .fauna-project file.`; | ||
NOTE: \`fauna project\` and \`fauna environment\` are still in beta. Behavior is subject to change.`; | ||
static examples = [ | ||
@@ -31,0 +29,0 @@ "$ fauna project init", |
@@ -26,20 +26,4 @@ import { Help, Interfaces } from "@oclif/core"; | ||
const betaTopicsSorted = []; | ||
const projectTopic = betaTopics.find((t) => t.name === "project"); | ||
if (projectTopic !== undefined) { | ||
betaTopicsSorted.push(projectTopic); | ||
} | ||
const environmentTopic = betaTopics.find((t) => t.name === "environment"); | ||
if (environmentTopic !== undefined) { | ||
betaTopicsSorted.push(environmentTopic); | ||
} | ||
betaTopicsSorted.push( | ||
...betaTopics.filter( | ||
(t) => t.name !== "project" && t.name !== "environment" | ||
) | ||
); | ||
return [...nonBetaTopics, ...betaTopicsSorted]; | ||
return [...nonBetaTopics, ...betaTopics]; | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
447936
11015
1335