-
Notifications
You must be signed in to change notification settings - Fork 890
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
Make cakephp/database an optional dependency #1754
Comments
We just removed the collection package as dependency, but I don't think it is feasible to drop the main ORM layer here at this point. |
I dont think removing the dependency is a useful goal. If phinx stays under cake, it is probably best long-term to make it use the cake db connection. |
Dependency tree for For users searching for temporary workaround, add {
"require": {
"robmorgan/phinx": "^2.0.2",
}
"replace": {
"cakephp/database": "*",
}
} |
Note: If cakephp/migrations#647 gets traction, then this is actually very likely going to be possible. |
I want to keep Phinx as little dependency as possible, so that I can run it in any framework without having to worry about so many compatibility issues |
After looking at/doing #1753, I wondered if it would be possible to also make it so that there was not an explicit dependency on
cakephp/database
(which would in-turn solve #1647), and even potentially offering alternatives to it if someone so wanted.The only thing that phinx relies on that library is to provide support for the
getQueryBuilder()
(AbstarctMigration) ->getQueryBuilder
(Adapter) ->getDecoratedConnection
(Adapter) ->cakephp/database
. If it was made optional, this method would just raise an exception ifcakephp/database
does not exist, else operate as it does currently. I think this gives the best of all worlds here in that the overall installation cost of phinx is lowered, it does not pollute any namespace by default, and for those who want the query builder can usecakephp/database
. For my own part, I do not use it in any of my projects as the few queries are simple enough to operate on all adapters as is).Finally, it might make sense to specify an additional option of a query builder such as https://github.com/shadowhand/latitude, though make it clear that
cakephp/database
is the favored suggestion in docs and such.The text was updated successfully, but these errors were encountered: