Skip to content

Storage calculations - #930

Merged
fogelito merged 5 commits into
mainfrom
storage-calc
Aug 18, 2026
Merged

Storage calculations#930
fogelito merged 5 commits into
mainfrom
storage-calc

Conversation

@fogelito

@fogelito fogelito commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Performance Improvements
    • Improved collection size reporting by retrieving related table sizes more efficiently in a single operation.
    • Preserved existing error handling while ensuring size values are returned as whole numbers.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 288f5c65-6fa7-4a4c-a261-e54d889597a0

📥 Commits

Reviewing files that changed from the base of the PR and between 6f8f0d6 and 3212acf.

📒 Files selected for processing (1)
  • src/Database/Adapter/MariaDB.php
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Database/Adapter/MariaDB.php

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The MariaDB adapter now retrieves collection and permissions table sizes with one prepared INFORMATION_SCHEMA.TABLES query. It combines results with UNION ALL, executes once, and returns the total as an integer.

Changes

MariaDB collection size

Layer / File(s) Summary
Combine collection size metadata queries
src/Database/Adapter/MariaDB.php
getSizeOfCollection() uses one prepared query with UNION ALL, binds all parameters once, preserves PDO exception handling, and casts the result to int.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 3212a

The current change has no actionable merge-blocking risk identified and is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change to collection and permissions storage calculations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch storage-calc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR consolidates collection and permissions-table size calculations into one database round trip and normalizes the result to an integer.

  • Replaces two INFORMATION_SCHEMA.TABLES queries with one UNION ALL aggregate.
  • Uses distinct prepared-statement parameters for each schema predicate.
  • Preserves database-exception wrapping while returning a whole-number size.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/Database/Adapter/MariaDB.php Consolidates the two table-size lookups into one parameterized aggregate query; no eligible follow-up defect was established.

Reviews (3): Last reviewed commit: "Address comments" | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/Database/Adapter/MariaDB.php`:
- Around line 293-304: Update the SQL in the MariaDB adapter’s size query to use
distinct PDO placeholders for each table_schema predicate, then bind $database
to both markers in the adjacent bindParam calls. Keep the existing $collection
and $permissions bindings unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 96672097-f8c0-434a-a2bb-c707f6b26271

📥 Commits

Reviewing files that changed from the base of the PR and between ce4e14e and 6f8f0d6.

📒 Files selected for processing (1)
  • src/Database/Adapter/MariaDB.php

Comment thread src/Database/Adapter/MariaDB.php Outdated
@fogelito
fogelito merged commit 383deae into main Aug 18, 2026
39 of 40 checks passed
@fogelito
fogelito deleted the storage-calc branch August 18, 2026 07:29
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