-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finish the database list
command
#448
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questions
const getOutputFields = (argv) => { | ||
if (!argv.secret && !argv.database) { | ||
// If we are listing top level databases the region group | ||
// needs to be included as database names can be re-used across | ||
// regions. | ||
return ["name", "region_group"]; | ||
} | ||
return ["name"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we choosing not to include has has_children
, region_group
and path
?
I realize that the core APIs can't give us this at this time.
Is it strictly for that reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I've included region_group
if listing at the top level as that is needed to disambiguate databases with the same name across region groups. Otherwise I've just kept it to name to be consistent when listing from both APIs. Theoretically you also know the region and path if listing with the --database
flag.
); | ||
} | ||
|
||
async function listDatabasesWithAccountAPI(argv) { | ||
const { pageSize, database, json } = argv; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we not supporting pagination?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't want to tackle that here but I can in a follow up
"$0 database list --secret 'my-secret'", | ||
"list all databases using the provided database secret", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does fauna database list --secret 'my-secret' --database 'eu-std/example'
do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You get this error message Cannot use both the '--secret' and '--database' options together. Please specify only one.
test/database/list.mjs
Outdated
import { run } from "../../src/cli.mjs"; | ||
import { setupTestContainer as setupContainer } from "../../src/config/setup-test-container.mjs"; | ||
|
||
describe("database list", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the plan to test we get the output we actually we want?
Is that being saved for the integration test story?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's what I was thinking
c9f939e
to
70ed6fa
Compare
Ticket(s): FE-6126
Problem
The
database list
command does not support--secret
or--database
.Solution
Support the
--secret
and--database
flags by using the account API if no secret is given.Result
The
database list
command supports all expected flags.For example, the following commands should now all work:
fauna database list
fauna database list --secret 'my-secret'
fauna database list --database 'us-std/my-db'
fauna database list --json
fauna database list --pageSize 10
Testing