Closed wallacio closed 10 months ago
Taking inspiration from cakephp/database, why not replace the getQueryBuilder(string $type) method with type-specific methods, returning the appropriate data type?
e.g. for an INSERT statement,
function getQueryBuilder('insert'): Query
would be replaced with
function getInsertBuilder(): InsertQuery
PR open
Where is the "official" documentation for 0.15?
We've been using 0.13.x for some time now, for which there's great documentation at https://book.cakephp.org/phinx/0/en/index.html.
A recent
composer update
(amongst other things) has bumped phinx to the 0.15.x release. There are a few breaking changes introduced here, some of which are documented and which I have resolved locally. What I struggled with in particular is working out howgetQueryBuilder()
works. For starters, it requires a parameter for the query type (e.g. 'select', 'update' etc.) https://github.com/cakephp/phinx/blob/ccbb7f2b4bf1297fec64447d1f4a773f5d9455e0/src/Phinx/Db/Adapter/AdapterInterface.php#L288Typehinting is also wrong; whilst
getQueryBuilder()
returnsCake\Database\Query
, the IDE doesn't recognise methods belonging to the relevant child class, for exampleCake\Database\UpdateQuery
which has the methodsupdate()
andset()
:Whilst I appreciate that this typehinting is probably an issue with cakephp\database, it would be great to see some official documentation for 0.15 detailing these changes. There is of course every chance that I'm now using getQueryBuilder incorrectly but I can't see the alternative.