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

deprecate all ORM proxy commands #1581

Merged
merged 1 commit into from
Nov 16, 2022

Conversation

dmaicher
Copy link
Contributor

@dmaicher dmaicher commented Nov 14, 2022

Closes #1524

List of all doctrine commands from this bundle as tested on one of my apps using this branch:

      doctrine:database:create                  Creates the configured database                                                                                    
      doctrine:database:drop                    Drops the configured database                                                                                      
      doctrine:query:sql                        Executes arbitrary SQL directly from the command line.                                                             
      doctrine:cache:clear-metadata             Clear all metadata cache of the various cache drivers                                                              
      doctrine:cache:clear-query                Clear all query cache of the various cache drivers                                                                 
      doctrine:cache:clear-result               Clear all result cache of the various cache drivers                                                                
      doctrine:cache:clear-collection-region    Clear a second-level cache collection region                                                                       
      doctrine:mapping:convert                  Convert mapping information between supported formats                                                              
      doctrine:schema:create                    Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output  
      doctrine:schema:drop                      Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output     
      doctrine:ensure-production-settings       Verify that Doctrine is properly configured for a production environment                                           
      doctrine:cache:clear-entity-region        Clear a second-level cache entity region                                                                           
      doctrine:mapping:info                     Show basic information about all mapped entities                                                                   
      doctrine:cache:clear-query-region         Clear a second-level cache query region                                                                            
      doctrine:query:dql                        Executes arbitrary DQL directly from the command line                                                              
      doctrine:schema:update                    Executes (or dumps) the SQL needed to update the database schema to match the current mapping metadata             
      doctrine:schema:validate                  Validate the mapping files                                                                                         
      doctrine:mapping:import                   Imports mapping information from an existing database     

@dmaicher dmaicher added this to the 2.8.0 milestone Nov 14, 2022
@dmaicher dmaicher marked this pull request as ready for review November 14, 2022 20:26
@dmaicher dmaicher marked this pull request as draft November 14, 2022 20:44
@dmaicher dmaicher marked this pull request as ready for review November 14, 2022 20:51
@stof
Copy link
Member

stof commented Nov 15, 2022

The doctrine:query:dql command is redefining the help text instead of inheriting it from the parent. Can you check why this was done ? Is the help text of the bundle better than the help text of the ORM ?

@stof
Copy link
Member

stof commented Nov 15, 2022

This should probably also deprecate the proxy commands for DBAL commands. For now, you handle only ORM ones.

@dmaicher
Copy link
Contributor Author

The doctrine:query:dql command is redefining the help text instead of inheriting it from the parent. Can you check why this was done ? Is the help text of the bundle better than the help text of the ORM ?

ORM:

Executes arbitrary DQL directly from the command line.

Bundle:

The <info>%command.name%</info> command executes the given DQL query and
outputs the results:

<info>php %command.full_name% "SELECT u FROM UserBundle:User u"</info>

You can also optional specify some additional options like what type of
hydration to use when executing the query:

<info>php %command.full_name% "SELECT u FROM UserBundle:User u" --hydrate=array</info>

Additionally you can specify the first result and maximum amount of results to
show:

<info>php %command.full_name% "SELECT u FROM UserBundle:User u" --first-result=0 --max-result=30</info>

So yeah seems better 😄

@stof
Copy link
Member

stof commented Nov 15, 2022

I suggest improving the help in the ORM (without using the entity namespace feature that has been removed in doctrine/persistence 3.x)

@dmaicher
Copy link
Contributor Author

@stof see doctrine/orm#10233

@dmaicher
Copy link
Contributor Author

@stof regarding

This should probably also deprecate the proxy commands for DBAL commands. For now, you handle only ORM ones.

Which DBAL command are you referring to exactly?

From what I can tell all commands inside the Command\Proxy namespace are now deprecated.

Screenshot from 2022-11-15 17-03-21

@stof
Copy link
Member

stof commented Nov 15, 2022

Actually, the deprecation of DBAL proxy commands was half-done already. For instance, Doctrine\Bundle\DoctrineBundle\Command\Proxy\RunSqlDoctrineCommand is marked as deprecated, but it is still used when running the command (unlike your change where you use the ORM commands directly for service definitions)

@dmaicher
Copy link
Contributor Author

@stof I will do this for the DBAL command(s) separately. Ok?

@dmaicher dmaicher merged commit 03ad8e6 into doctrine:2.8.x Nov 16, 2022
@dmaicher dmaicher deleted the deprecate_orm_proxy_commands branch November 16, 2022 09:04
@dmaicher
Copy link
Contributor Author

@stof @ostrolucky actually this is done already for the DBAL command, right?

Checking

95c9daf#diff-11eb636a4aa9dc6c6b58251b233250d85cb1b8c16ec5845574e7a5b4fd90ff42R105

I see that because of the changed command name doctrine:query:sql vs dbal:run-sql basically we now have both classes registered as services.

@ostrolucky
Copy link
Member

yeah

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