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

Return sizes in listDatabases #61

Closed
ferretdb-bot opened this issue Nov 15, 2021 · 3 comments
Closed

Return sizes in listDatabases #61

ferretdb-bot opened this issue Nov 15, 2021 · 3 comments
Labels
code/feature Some user-visible feature is not implemented yet good first issue Good issues for new external contributors
Milestone

Comments

@ferretdb-bot
Copy link
Member

listDatabases command should return sizes of each database (PostgreSQL schema) as well as PostgreSQL database total size on disk.

The latter is easy: just call SELECT pg_database_size(current_database()) and convert result. pg_database_size is documented there.

The former is only slightly harder. Let's call pg_total_relation_size on each table. Getting a table list is already implemented in the MsgListCollections method; small refactoring to remove duplication might be needed.

Tests should be added too.

See linked commit for code locations.

@ferretdb-bot ferretdb-bot added code/feature Some user-visible feature is not implemented yet good first issue Good issues for new external contributors labels Nov 15, 2021
ferretdb-bot pushed a commit that referenced this issue Nov 15, 2021
@OpenSauce
Copy link
Contributor

I can have a look at this tomorrow 😃

@OpenSauce
Copy link
Contributor

Can be closed? :)

@ferretdb-bot
Copy link
Member Author

Absolutely!

@ferretdb-bot ferretdb-bot added this to the v0.0.4 milestone Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/feature Some user-visible feature is not implemented yet good first issue Good issues for new external contributors
Projects
None yet
Development

No branches or pull requests

2 participants