Skip to content

Commit

Permalink
Improve DB names in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jrodewig committed Dec 17, 2024
1 parent 00b81f1 commit b5af5c7
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ To get started:
hierarchy, to run the command in. For example:

```shell
# Runs a query in the top-level 'example' database
# Runs a query in the top-level 'my_db' database
# in the 'us' Region Group. Use the default admin role.
fauna query "Collection.all()" \
--database us/example
--database us/my_db
```

## Installation
Expand Down
16 changes: 8 additions & 8 deletions src/commands/database/create.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -100,23 +100,23 @@ function buildCreateCommand(yargs) {
.check(validateDatabaseOrSecret)
.example([
[
"$0 database create --name example --database us",
"Create the top-level 'example' database in the 'us' Region Group.",
"$0 database create --name my_db --database us",
"Create the top-level 'my_db' database in the 'us' Region Group.",
],
[
"$0 database create --name my_db --database us/example",
"Create the 'my_db' child database directly under 'us/example'.",
"$0 database create --name child_db --database us/parent_db",
"Create the 'child_db' child database directly under 'us/parent_db'.",
],
[
"$0 database create --name my_db --secret my-secret",
"Create the 'my_db' child database directly under the database scoped to a secret.",
"$0 database create --name child_db --secret my-secret",
"Create the 'child_db' child database directly under the database scoped to a secret.",
],
[
"$0 database create --name example --database us --typechecked",
"$0 database create --name my_db --database us --typechecked",
"Create a database with typechecking enabled.",
],
[
"$0 database create --name example --database us --protected",
"$0 database create --name my_db --database us --protected",
"Create a database with protected mode enabled.",
],
]);
Expand Down
12 changes: 6 additions & 6 deletions src/commands/database/delete.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ function buildDeleteCommand(yargs) {
.check(validateDatabaseOrSecret)
.example([
[
"$0 database delete --name example --database us",
"Delete the top-level 'example' database in the 'us' Region Group.",
"$0 database delete --name my_db --database us",
"Delete the top-level 'my_db' database in the 'us' Region Group.",
],
[
"$0 database delete --name my_db --database us/example",
"Delete the 'my_db' child database directly under 'us/example'.",
"$0 database delete --name child_db --database us/parent_db",
"Delete the 'child_db' child database directly under 'us/parent_db'.",
],
[
"$0 database delete --name my_db --secret my-secret",
"Delete the 'my_db' child database directly under the database scoped to a secret.",
"$0 database delete --name child_db --secret my-secret",
"Delete the 'child_db' child database directly under the database scoped to a secret.",
],
]);
}
Expand Down
4 changes: 2 additions & 2 deletions src/commands/database/list.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ function buildListCommand(yargs) {
.example([
["$0 database list", "List all top-level databases."],
[
"$0 database list --database us/example",
"List all child databases directly under the 'us/example' database.",
"$0 database list --database us/parent_db",
"List all child databases directly under the 'us/parent_db' database.",
],
[
"$0 database list --secret my-secret",
Expand Down
6 changes: 3 additions & 3 deletions src/commands/local.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,11 @@ function buildLocalCommand(yargs) {
"Map host port `1234` to container port `6789`.",
],
[
"$0 local --database example",
"Start a local Fauna container with the 'example' database.",
"$0 local --database my_db",
"Start a local Fauna container with the 'my_db' database.",
],
[
"$0 local --database example --dir /path/to/schema/dir",
"$0 local --database my_db --dir /path/to/schema/dir",
"Start a local Fauna container with a database with specified schema.",
],
]);
Expand Down
14 changes: 7 additions & 7 deletions src/commands/query.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,27 @@ function buildQueryCommand(yargs) {
})
.example([
[
'$0 query "Collection.all()" --database us/example',
"Run the query in the 'us/example' database and write the results to stdout.",
'$0 query "Collection.all()" --database us/my_db',
"Run the query in the 'us/my_db' database and write the results to stdout.",
],
[
'$0 query "Collection.all()" --database us/example --role server',
"Run the query in the 'us/example' database using the 'server' role.",
'$0 query "Collection.all()" --database us/my_db --role server',
"Run the query in the 'us/my_db' database using the 'server' role.",
],
[
'$0 query "Collection.all()" --secret my-secret',
"Run the query in the database scoped to a secret.",
],
[
"$0 query -i /path/to/query.fql --database us/example",
"$0 query -i /path/to/query.fql --database us/my_db",
"Run the query from a file.",
],
[
'echo "1 + 1" | $0 query - --database us/example',
'echo "1 + 1" | $0 query - --database us/my_db',
"Run the query from stdin.",
],
[
"$0 query -i /path/to/queries.fql --output /tmp/result.json --database us/example",
"$0 query -i /path/to/query.fql --output /tmp/result.json --database us/my_db",
"Run the query and write the results to a file.",
],
]);
Expand Down
6 changes: 3 additions & 3 deletions src/commands/schema/abandon.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ function buildAbandonCommand(yargs) {
})
.example([
[
"$0 schema abandon --database us/example",
"Abandon staged schema for the 'us/example' database.",
"$0 schema abandon --database us/my_db",
"Abandon staged schema for the 'us/my_db' database.",
],
[
"$0 schema abandon --secret my-secret",
"Abandon staged schema for the database scoped to a secret.",
],
[
"$0 schema abandon --database us/example --no-input",
"$0 schema abandon --database us/my_db --no-input",
"Run the command without input prompts.",
],
]);
Expand Down
6 changes: 3 additions & 3 deletions src/commands/schema/commit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ function buildCommitCommand(yargs) {
})
.example([
[
"$0 schema commit --database us/example",
"Commit staged schema for the 'us/example' database.",
"$0 schema commit --database us/my_db",
"Commit staged schema for the 'us/my_db' database.",
],
[
"$0 schema commit --secret my-secret",
"Commit staged schema for the database scoped to a secret.",
],
[
"$0 schema commit --database us/example --no-input",
"$0 schema commit --database us/my_db --no-input",
"Run the command without input prompts.",
],
]);
Expand Down
14 changes: 7 additions & 7 deletions src/commands/schema/diff.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -132,23 +132,23 @@ function buildDiffCommand(yargs) {
})
.example([
[
"$0 schema diff --database us/example --dir /path/to/schema/dir",
"Compare the 'us/example' database's staged schema to the local schema. If no schema is staged, compare the database's active schema to the local schema.",
"$0 schema diff --database us/my_db --dir /path/to/schema/dir",
"Compare the 'us/my_db' database's staged schema to the local schema. If no schema is staged, compare the database's active schema to the local schema.",
],
[
"$0 schema diff --database us/example --dir /path/to/schema/dir --active",
"Compare the 'us/example' database's active schema to the local schema.",
"$0 schema diff --database us/my_db --dir /path/to/schema/dir --active",
"Compare the 'us/my_db' database's active schema to the local schema.",
],
[
"$0 schema diff --secret my-secret --dir /path/to/schema/dir --active",
"Compare the active schema of the database scoped to a secret to the local schema.",
],
[
"$0 schema diff --database us/example --dir /path/to/schema/dir --staged",
"Compare the 'us/example' database's active schema to its staged schema.",
"$0 schema diff --database us/my_db --dir /path/to/schema/dir --staged",
"Compare the 'us/my_db' database's active schema to its staged schema.",
],
[
"$0 schema diff --database us/example --dir /path/to/schema/dir --text",
"$0 schema diff --database us/my_db --dir /path/to/schema/dir --text",
"Show a text diff instead of a semantic diff.",
],
]);
Expand Down
10 changes: 5 additions & 5 deletions src/commands/schema/pull.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -152,19 +152,19 @@ function buildPullCommand(yargs) {
})
.example([
[
"$0 schema pull --database us/example --dir /path/to/schema/dir",
"Pull the 'us/example' database's staged schema.",
"$0 schema pull --database us/my_db --dir /path/to/schema/dir",
"Pull the 'us/my_db' database's staged schema.",
],
[
"$0 schema pull --secret my-secret --dir /path/to/schema/dir",
"Pull the staged schema for the database scoped to a secret.",
],
[
"$0 schema pull --database us/example --dir /path/to/schema/dir --active",
"Pull the 'us/example' database's active schema.",
"$0 schema pull --database us/my_db --dir /path/to/schema/dir --active",
"Pull the 'us/my_db' database's active schema.",
],
[
"$0 schema pull --database us/example --dir /path/to/schema/dir --delete",
"$0 schema pull --database us/my_db --dir /path/to/schema/dir --delete",
"Delete .fsl files in the local directory that are not part of the pulled schema.",
],
]);
Expand Down
10 changes: 5 additions & 5 deletions src/commands/schema/push.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ function buildPushCommand(yargs) {
})
.example([
[
"$0 schema push --database us/example --dir /path/to/schema/dir",
"Stage schema changes for the 'us/example' database. If schema is already staged, replace the staged schema.",
"$0 schema push --database us/my_db --dir /path/to/schema/dir",
"Stage schema changes for the 'us/my_db' database. If schema is already staged, replace the staged schema.",
],
[
"$0 schema push --secret my-secret --dir /path/to/schema/dir",
"Stage schema changes for the database scoped to a secret. If schema is already staged, replace the staged schema.",
],
[
"$0 schema push --database us/example --dir /path/to/schema/dir --active",
"Immediately apply changes to the 'us/example' database's active schema.",
"$0 schema push --database us/my_db --dir /path/to/schema/dir --active",
"Immediately apply changes to the 'us/my_db' database's active schema.",
],
[
"$0 schema push --database us/example --dir /path/to/schema/dir --no-input",
"$0 schema push --database us/my_db --dir /path/to/schema/dir --no-input",
"Run the command without input prompts.",
],
]);
Expand Down
4 changes: 2 additions & 2 deletions src/commands/schema/status.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function buildStatusCommand(yargs) {
.options(localSchemaOptions)
.example([
[
"$0 schema status --database us/example",
"Get the staged schema status for the 'us/example' database.",
"$0 schema status --database us/my_db",
"Get the staged schema status for the 'us/my_db' database.",
],
[
"$0 schema status --secret my-secret",
Expand Down
8 changes: 4 additions & 4 deletions src/commands/shell.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ function buildShellCommand(yargs) {
return yargsWithCommonConfigurableQueryOptions(yargs)
.example([
[
"$0 shell --database us/example",
"Run queries in the 'us/example' database.",
"$0 shell --database us/my_db",
"Run queries in the 'us/my_db' database.",
],
[
"$0 shell --database us/example --role server",
"Run queries in the 'us/example' database using the 'server' role.",
"$0 shell --database us/my_db --role server",
"Run queries in the 'us/my_db' database using the 'server' role.",
],
[
"$0 shell --secret my-secret",
Expand Down

0 comments on commit b5af5c7

Please sign in to comment.