-
Notifications
You must be signed in to change notification settings - Fork 15
fix: SchemaBuilder::getColumns was missing values #280
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
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the """ WalkthroughThe updates refine column metadata handling by improving type annotations and field access in the Changes
Suggested labels
Suggested reviewers
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/Query/Processor.php(1 hunks)src/Schema/Grammar.php(1 hunks)tests/Schema/BuilderTestLast.php(1 hunks)
🔇 Additional comments (4)
src/Schema/Grammar.php (1)
52-71: Query improvements enhance column metadata retrieval.The rewritten
compileColumnsmethod now explicitly selects specific column attributes (name,type,nullable,default) and provides them with consistent lowercase aliases. This makes the column metadata retrieval more precise and aligns with the updatedprocessColumnsmethod in the Processor class.The table filtering was also improved by removing the empty
table_schemafilter, which might have been limiting the results. The use ofimplodefor constructing the query parts enhances readability.src/Query/Processor.php (1)
76-77: Improved type annotations for better code documentation.The parameter and return type annotations now use more specific types, providing better documentation and type safety when working with the column metadata.
tests/Schema/BuilderTestLast.php (2)
225-246: Improved test with more specific assertions for nullable columns.The test was renamed to clarify its purpose and now includes more detailed assertions to verify the correct handling of a nullable integer primary key column. The test ensures that all required column properties are properly populated in the metadata.
248-269: Added test coverage for columns with default values.This new test ensures that default values are correctly captured and processed in the column metadata, particularly for string columns with default values. The assertions verify that the type, nullability, and default value are all correctly represented.
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/Query/Processor.php(1 hunks)src/Schema/Grammar.php(1 hunks)tests/Schema/BuilderTestLast.php(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/Schema/BuilderTestLast.php
- src/Query/Processor.php
🧰 Additional context used
🪛 PHPStan (2.0.3)
src/Schema/Grammar.php
59-59: Method Colopl\Spanner\Schema\Grammar::compileColumns() overrides method Illuminate\Database\Schema\Grammars\Grammar::compileColumns() but misses parameter #2 $table.
(parameter.missing)
0b48db6 to
ba405d0
Compare
Co-authored-by: halnique <[email protected]>
halnique
left a comment
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.
LGTM
* fix!: SchemaBuilder::getForeignKeys was returning incorrect values (#275) * fix!: SchemaBuilder::getTables was returning incorrect values (#278) * fix: SchemaBuilder::getColumns was missing values (#280) Co-authored-by: halnique <[email protected]> * fix: phpstan errors * fix --------- Co-authored-by: halnique <[email protected]>
The following is in this fix.
Summary by CodeRabbit