Skip to content
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

add filterAssetNames to get asset tables #6729

Closed
wants to merge 1 commit into from

Conversation

eltharin
Copy link

@eltharin eltharin commented Jan 17, 2025

Q A
Type bug
Fixed issues (doctrine/DoctrineMigrationsBundle#584)

Summary

add a parameter to can get all tables (with assets), use for a bug in migrations, TableMetadataStorage appear as not initialized

need doctrine/migrations#1484

add a parameter to can get all tables (with asserts), use for a bug in migrations, TableMetadataStorage appear as not initialized
@eltharin eltharin force-pushed the all_tables_for_initialized branch from 765e903 to 2445518 Compare January 17, 2025 21:15
@eltharin eltharin changed the title add filterAssetNames to get assert tables add filterAssetNames to get asset tables Jan 18, 2025
@morozov
Copy link
Member

morozov commented Jan 21, 2025

I don't think we should keep supporting filtering asset names as a feature. Prior to #5268, the filter applied within the schema manager would optimize the number of O(n) queries performed to introspect the schema. Now, the number of queries performed is O(1), so this optimization is no longer relevant.

Note that this filter is applied on the client side, not as a query predicate (because it's a PHP callable), so regardless of the presence of the filter, DBAL selects all tables' columns, indexes, etc. and then just discards some of them while constructing Table objects.

I believe we should deprecate filtering asset names in the DBAL altogether and delegate it downstream (e.g. to Migrations). This way, the expected migration experience would be implemented in the application that performs the migration, w/o the need to maintain the functions that don't belong to a DBAL here.

@greg0ire what do you think?

Another data point is that I want to extract the schema introspection API from schema manager to a different component (say, schema provider). The primary reason being that instead of accepting names as string and having to parse them (see the usage of new Identifier() in the schema manager), the API should accept Name objects (e.g. OptionallyQualifiedName $tableName). Creating a new API will provide an upgrade path. And I don't really want to implement asset filtering there for the reasons described above.

@greg0ire
Copy link
Member

I think that's in line with what I'm doing here

For context, @eltharin is trying to address doctrine/DoctrineMigrationsBundle#584, but I think the right way to do so is like so: doctrine/DoctrineMigrationsBundle#587

@morozov
Copy link
Member

morozov commented Jan 21, 2025

I think that's in line with what I'm doing here

Great. In this case, I will close this one as "Won't Do" and proceed with the deprecation.

@eltharin
Copy link
Author

I close the other too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants