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 DBAL's MasterSlaveConnection support #33

Merged
merged 2 commits into from
Sep 3, 2019

Conversation

ninsuo
Copy link
Contributor

@ninsuo ninsuo commented Mar 5, 2019

Hello there,

In Doctrine, the Doctrine\DBAL\Connections\MasterSlaveConnection class is a wrapper that adds support to transparently use different read and write connections for a single database.

This PR adds its support in a very simple way:

  • Moved all the code in the Facile's Connection class into a new ConnectionTrait
  • Made Facile's Connection use that trait
  • Copied Facile's Connection class into MasterSlaveConnection that simply extends DBAL's MasterSlaveConnection instead of DBAL's Connection
  • Added a ConnectionInterface in order to inject any of the 2 classes in the Facile's Statement constructor, instead of Connection only

Everything works as expected on our project.

Please note: Doctrine places its MasterSlaveConnection in a Connections directory, so I respected their path even though it looks a bit strange.

Thank you for your work and enjoy!

Alain

@ninsuo ninsuo changed the title Add DBAL's MasterSlaveConnection support to mysql-come-back Add DBAL's MasterSlaveConnection support Mar 5, 2019
@ninsuo ninsuo force-pushed the master branch 2 times, most recently from 8867425 to 90035de Compare March 6, 2019 11:28
@peelandsee
Copy link
Member

hey @ninsuo ,
so sorry for the late reply.

just to confirm we're looking at this this week,
expect an update soon.

sorry again..

Copy link
Member

@peelandsee peelandsee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 👍

@peelandsee
Copy link
Member

merging,
thanks @ninsuo!

we'll tag a new release this week

@peelandsee peelandsee closed this Sep 3, 2019
@peelandsee peelandsee reopened this Sep 3, 2019
@peelandsee peelandsee merged commit 5c4db76 into facile-it:master Sep 3, 2019
@peelandsee
Copy link
Member

@ninsuo v1.8, released today, contains your merge

thanks again,

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