cockroachdb-laravel
cockroachdb-laravel copied to clipboard
[BUGFIX] Add custom CockroachSchemaManager and override selectTableColumns() / fixes #35
Changes In Code
Add custom CockroachSchemaManager extending the PostgreSQLSchemaManager and override the selectTableColumns() function to add the a.attisdropped = false flag to the SQL query.
Additionally override compileColumns function in CockroachGrammar-Class to fix the output of the Schema::getColumns function.
Issue ticket number / Business Case
https://github.com/ylsideas/cockroachdb-laravel/issues/35
Checklist before requesting a review
- [x] I have written PHP tests.
- [x] I have updated the documentation in the readme where needed.
- [x] I have checked code styles, PHPStan etc. pass.
- [x] I have provided an issue/business case.
Codecov Report
Attention: Patch coverage is 92.30769% with 3 lines in your changes are missing coverage. Please review.
Project coverage is 93.12%. Comparing base (
68c2628) to head (c97190c). Report is 1 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| src/Schema/CockroachSchemaManager.php | 86.95% | 3 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #36 +/- ##
============================================
+ Coverage 91.39% 93.12% +1.73%
- Complexity 32 39 +7
============================================
Files 7 9 +2
Lines 93 131 +38
============================================
+ Hits 85 122 +37
- Misses 8 9 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Vision42 I was unable to push fixes directly to your branch but I've created a patch file.
cockroachdb-laravel-320d3be-Add mechanism to handle failing with outdated DBAL.patch
What my changes do, is it will allow users to use the package with outdated Dbal installs but it will flag an exception that they should warn they need to update to a new version. For the tests, if Dbal is below 3.5 then those tests will be skipped. This feels like the best way to make users aware that they might have problems if they're using an outdated package without forcing it as Dbal isn't a Laravel dependency and I don't want to make it one for this package either especially as it's no longer used in Laravel 11.
I just want to say thank you for your patience and hard work on this as well. Projects like this one only really work with contributors such as yourself.