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

Update Adapter classes to use Connection pt1 #694

Merged
merged 10 commits into from
Feb 26, 2024
Merged

Conversation

markstory
Copy link
Member

@markstory markstory commented Feb 23, 2024

Remove usage of PDO within Adapter classes. We can use the Connection abstractions provided by Cake\Database instead. There is a potentially significant change around adapter->query() as it now returns Cake statement wrappers which default to numeric field fetching instead of 'assoc' fetching like phinx did.

There is more that could be done around using Connection better as there is still a lot of string interpolation in query building instead of using prepared statements and lots of duplication between what phinx was doing and what cake's database layer does.

Part of #647

Instead of drilling into PDO, Migrations adapters should use the
Database\Connection API instead. This creates a few behavioral
differences from before. I hope that this level of abstraction wasn't
commonly used by userland code.
- Update implementation to use `Connection` methods
- Remove redundant tests
@ADmad
Copy link
Member

ADmad commented Feb 23, 2024

...which default to numeric field fetching instead of 'assoc' fetching like phinx did.

I really wanted to change it to assoc in 5.0 but chickened out :(

@markstory markstory merged commit 8b8c6b2 into no-phinx Feb 26, 2024
10 of 11 checks passed
@markstory markstory deleted the connection-adapter branch February 26, 2024 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants