-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Optimize introspection of table comments on PostgreSQL #5449
Conversation
96e8efc
to
bd983fb
Compare
* @param string|null $tableName | ||
* |
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.
* @param string|null $tableName | |
* |
*/ | ||
private function getTableWhereClause($table, $classAlias = 'c', $namespaceAlias = 'n'): string | ||
private function buildQueryConditions($tableName): array |
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.
private function buildQueryConditions($tableName): array | |
private function buildQueryConditions(?string $tableName): array |
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.
You're right. We don't have strict types enabled here, so even given that the public methods that call this one don't enforce the type of $tableName
, we can rely on implicit casting here.
But this is non-essential and is hard to reason about since these requirements aren't enforced by the code style or static analysis. We do want to enforce parameter types on all new APIs but it's not a public API.
This change will be consistently implemented during the merge up to 4.0.x.
The current implementation of
PostgreSQLSchemaManager::fetchTableOptionsByTable()
fetches the comment of each table individually although the API introduced in #5268 enables fetching schema metadata in a fixed number of queries.Additionally, some cleanup is done in the codebase.