-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add a function to get the size of a collection/table in bytes. #272
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.
Great start 😁
Awesome, nice work!
Please try to dig into this further, we'll need to get all adapters working. How are you running the tests? The Postgres issue is strange for the test suite. For the SQLite issue, try some extra debugging, adding
Awesome, let's add those methods too
Let's address that seperately, it's outside the scope of this PR. Make sure you've merge in the upstream main branch too, a lot of the |
|
|
src/Database/Adapter/SQLite.php
Outdated
SELECT SUM(\"pgsize\") FROM \"dbstat\" WHERE name='{$namespace}_{$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.
Let's fix the indentation here
@abnegate, |
@abnegate , |
@abnegate , |
@abnegate Made the changes |
I think we missed the full-text index calculations table size? since there are additional tables. |
looks like the first FT will create 6 table: with 5 additional table: appwrite/fts_00000000000004a9_deleted_cache The second fulltext index for the same table will create only 6 tables |
@fogelito Any ideas how we can count those too? |
@faisalill Please add another test that:
|
@abnegate |
What's Changed:
Added
getCollectionSize
method to MariaDB, MySQL, SQLite and MongoDB adapters.The function for Postgres is working but it is giving an error during test so I just commented the code out.
Tests:
I have checked manually using the
getCollectionSize
method it worked.I did add a test to check whether it returns a string.