-
Notifications
You must be signed in to change notification settings - Fork 15
feat: named schema support #288
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
WalkthroughThe changes introduce comprehensive support for named schemas in the schema management and introspection components. In the schema builder, methods are updated to handle schema-qualified table names throughout table, index, and foreign key operations. SQL grammar methods are enhanced to support schema filtering, array schema inputs, and consistent identifier quoting. The blueprint class now generates index names with schema awareness. The test suite is expanded with new methods to verify correct behavior for named schemas, including creation, listing, column, index, and foreign key retrieval. Emulator setup is improved with authentication caching and polling adjustments. Assessment against linked issues
Suggested labels
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🧰 Additional context used🧠 Learnings (5)📓 Common learningstests/TestCase.php (1)src/Schema/Blueprint.php (1)src/Schema/Grammar.php (1)tests/Schema/BuilderTestLast.php (1)🧬 Code Graph Analysis (2)src/Schema/Builder.php (1)
src/Schema/Blueprint.php (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (12)
✨ Finishing Touches
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.
Pull Request Overview
Adds support for named schemas in Spanner by extending schema building, grammar queries, and tests.
- Introduces
generateNamedSchemaNameand configures emulator client inTestCase.php - Adds comprehensive tests for named-schema flows in
BuilderTestLast.php - Updates
Grammar.php,Builder.php, andBlueprint.phpto handle schema-qualified identifiers and index naming
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/TestCase.php | Added generateNamedSchemaName, Str import, authCache, and polling options for emulator setup |
| tests/Schema/BuilderTestLast.php | Added tests covering named-schema support for tables, columns, indexes, foreign keys, and listings |
| src/Schema/Grammar.php | Quoted identifiers and added schema filtering to compile methods |
| src/Schema/Builder.php | Introduced createNamedSchema and updated dropAllTables to use schema-qualified names |
| src/Schema/Blueprint.php | Overrode createIndexName to include schema prefix when generating index names |
Comments suppressed due to low confidence (2)
tests/Schema/BuilderTestLast.php:356
- [nitpick] The test name suggests only default schema listing but it actually verifies both default and named schema results. Consider renaming the test to reflect that it covers both cases (e.g., test_getTableListing__for_default_and_named_schemas).
public function test_getColumns__for_named_schema_table(): void
tests/TestCase.php:145
- [nitpick] Using a pollingIntervalSeconds of 0.001 may be cast to 0 and result in a busy-wait loop or CPU spike. Consider using an integer or supported precision (e.g., 1 second) or verify that fractional intervals are honored by the emulator client.
'pollingIntervalSeconds' => 0.001,
Closes #282