Skip to content
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

ui: Populate database filter dropdown in stmts page with SHOW DATABASES sql-over-http call #93657

Merged
merged 1 commit into from
Dec 22, 2022

Conversation

gtr
Copy link
Contributor

@gtr gtr commented Dec 14, 2022

Fixes: #70461.

Previously, the databases filter dropdown was populated by the
StatementsResponse API call.This would result in some databases for
which we do not receive any stmts to be ignored.According to above
issue, the database filter - drop down should always be populated with
cluster databases even when there are no statements or transactions for
them.This commit populates the database filter dropdown using the
getDatabasesList() API call which itself executes theSHOW DATABASES
SQL query.

Creating a new empty database from the SQL shell:
Screen Shot 2022-12-19 at 10 48 04 AM

Clicking the "Databases" dropdown:
Screen Shot 2022-12-19 at 10 54 36 AM

Release note(ui change): The databases filter dropdown in the stmts
page now uses the getDatabasesList() API call, resulting in all
cluster databases showing up.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@gtr gtr force-pushed the databases-filter branch 3 times, most recently from 9b250d6 to 5c51452 Compare December 19, 2022 17:59
@gtr gtr marked this pull request as ready for review December 19, 2022 18:00
@gtr gtr requested review from a team and removed request for a team December 19, 2022 18:00
Copy link
Contributor

@THardy98 THardy98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: just a couple nits and fix CI failures for src/views/statements/statements.spec.tsx and src/app.spec.tsx :)

Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @gtr)


pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.selectors.ts line 91 at r1 (raw file):

// selectDatabases returns the array of all databases in the cluster,
// regardless of whether they have statement statistics present in the data.

Could probably just have:
// selectDatabases returns the array of all databases in the cluster.


pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx line 222 at r1 (raw file):

// selectDatabases returns the array of all databases in the cluster,
// regardless of whether they have statement statistics present in the data.

Ditto.

Copy link
Contributor Author

@gtr gtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @THardy98)


pkg/ui/workspaces/cluster-ui/src/statementsPage/statementsPage.selectors.ts line 91 at r1 (raw file):

Previously, THardy98 (Thomas Hardy) wrote…

Could probably just have:
// selectDatabases returns the array of all databases in the cluster.

Done.


pkg/ui/workspaces/db-console/src/views/statements/statementsPage.tsx line 222 at r1 (raw file):

Previously, THardy98 (Thomas Hardy) wrote…

Ditto.

Done.

@gtr gtr force-pushed the databases-filter branch 3 times, most recently from fba9a06 to 7fac45b Compare December 22, 2022 19:22
@gtr
Copy link
Contributor Author

gtr commented Dec 22, 2022

bors r+

@gtr
Copy link
Contributor Author

gtr commented Dec 22, 2022

bors retry

@craig
Copy link
Contributor

craig bot commented Dec 22, 2022

Already running a review

…SES`

sql-over-http call

Fixes: cockroachdb#70461.

Previously, the databases filter dropdown was populated by the
`StatementsResponse` API call. This would result in some databases for
which we do not receive any stmts to be ignored. According to above
issue, the database filter-drop down should always be populated with
cluster databases even when there are no statements or transactions for
them. This commit populates the database filter dropdown using the
`getDatabasesList()` API call which itself executes the `SHOW DATABASES`
SQL query.

Release note (ui change): The databases filter dropdown in the stmts
page now uses the `getDatabasesList()` API call, resulting in all
cluster databases showing up.
@craig
Copy link
Contributor

craig bot commented Dec 22, 2022

Canceled.

@gtr
Copy link
Contributor Author

gtr commented Dec 22, 2022

bors r+

@craig
Copy link
Contributor

craig bot commented Dec 22, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Database filter in the Statements and Transactions overview page is not populated
3 participants