Skip to content

Fix: Resolve DBAL contract violation with truncate() method (#387)#393

Merged
armanist merged 1 commit into
quantum-php:masterfrom
Wiltzsu:fix/dbal-truncate-method
Jan 12, 2026
Merged

Fix: Resolve DBAL contract violation with truncate() method (#387)#393
armanist merged 1 commit into
quantum-php:masterfrom
Wiltzsu:fix/dbal-truncate-method

Conversation

@Wiltzsu

@Wiltzsu Wiltzsu commented Jan 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #387

Problem

  • deleteTable() existed only in SleekDbal, not in DbalInterface
  • IdiormDbal had no equivalent, breaking adapter interchangeability
  • Method name implied schema deletion vs actual data cleanup

Solution

  • Add truncate(): bool to DbalInterface contract
  • Implement in both SleekDbal and IdiormDbal
  • Replace all deleteTable() calls (11 files)
  • Fix deprecated nullable parameter in having()

Testing

All adapter tests pass (92 tests, 296 assertions)

Ensures DBAL adapter interchangeability.

…php#387)

Problem:
- deleteTable() existed only in SleekDbal, not in contract
- IdiormDbal lacked equivalent, breaking adapter interchangeability
- Method name implied schema deletion vs actual data cleanup

Solution:
- Add truncate(): bool to DbalInterface contract
- Implement truncate() in both SleekDbal and IdiormDbal
- Replace all deleteTable() usage throughout codebase
- Fix deprecated implicit nullable parameter in having() method

Files changed: 11
- 1 contract (DbalInterface)
- 2 adapters (SleekDbal, IdiormDbal)
- 6 module templates
- 2 test files

All adapter tests pass (92 tests, 296 assertions).
Fixes quantum-php#387
@codecov

codecov Bot commented Jan 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.72%. Comparing base (9491557) to head (1625d36).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
.../Libraries/Database/Adapters/Idiorm/IdiormDbal.php 0.00% 5 Missing ⚠️
.../Libraries/Database/Adapters/Sleekdb/SleekDbal.php 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #393      +/-   ##
============================================
- Coverage     80.80%   80.72%   -0.09%     
- Complexity     2462     2465       +3     
============================================
  Files           229      229              
  Lines          6533     6541       +8     
============================================
+ Hits           5279     5280       +1     
- Misses         1254     1261       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@armanist armanist merged commit ad6d524 into quantum-php:master Jan 12, 2026
4 of 6 checks passed
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.

DBAL contract violation: deleteTable() used as cleanup operation but missing in IdiormDbal

4 participants