Skip to content

Conversation

tcely
Copy link
Contributor

@tcely tcely commented Dec 11, 2024

This does what I set out to do, but I'm not sure I like it.

Possibly make a function to get the size then pretty print it.

It does what it says on the tin, so it may as well get merged like this.

@meeb
Copy link
Owner

meeb commented Dec 11, 2024

No objection to this, but probably might be nicer to use the database connection and check the vendor that's being used:

>>> from django.db import connection
>>> connection.vendor
'sqlite'

Using the database from the connection parameters might be cleaner too:

>>> connection.get_connection_params()['database']
'/home/some/path/to/a/db.sqlite3'

@tcely
Copy link
Contributor Author

tcely commented Dec 11, 2024

Those are good suggestions. I'll look into improving this.

@tcely tcely marked this pull request as draft December 11, 2024 16:36
@tcely tcely marked this pull request as ready for review January 24, 2025 13:47
@meeb
Copy link
Owner

meeb commented Jan 24, 2025

Looks nicer, you happy for this to be merged?

@tcely
Copy link
Contributor Author

tcely commented Jan 24, 2025

Yeah. filesizeformat needs to be fixed to use proper prefixes, but that can happen later.

@meeb meeb merged commit 3130ff2 into meeb:main Jan 24, 2025
@tcely tcely deleted the patch-2 branch January 24, 2025 15:08
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.

2 participants