-
-
Notifications
You must be signed in to change notification settings - Fork 21
use common sql interfaces #14
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
Conversation
|
see also amphp/mysql#74 |
|
@trowski the pool interface is here: https://github.com/amphp/sql/blob/master/src/Pool.php this conflicts with your latest commit, can you revert it? |
|
@trowski updated as well |
src/Internal/PooledStatement.php
Outdated
|
|
||
| final class PooledStatement implements Statement { | ||
| /** @var \Amp\Postgres\Pool */ | ||
| final class PooledStatement implements Statement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is no longer needed.
|
|
||
| use Amp\Promise; | ||
|
|
||
| interface Executor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should extend Amp\Sql\Executor and not repeat the methods in that interface.
| use Amp\Promise; | ||
| use Amp\Sql\Link as SqlLink; | ||
|
|
||
| interface Link extends Executor { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interface still needs to extend Executor as well.
src/Pool.php
Outdated
| public function setIdleTimeout(int $timeout); | ||
| interface Pool extends Link, SqlPool | ||
| { | ||
| public function notify(string $channel, string $payload = ""): Promise; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is already defined in Executor.
|
@trowski all done |
|
@trowski there are still some tests failing, wanna look into it? you can submit a PR to my branch. |
|
@prolic I have fixed the failing tests in the Rather than PR'ing this against your fork and creating a superfluous merge commit, you should be able to simply pull the changes from that branch into yours by doing something like: |
|
@DaveRandom thanks, it's done. |
|
As it currently stands, I don't think the interface layout is quite right. The thing that sets off alarm bells is that neither of the concrete I also have some issues with the interfaces defined upstream by the |
|
@DaveRandom Yep, looks like
|
|
@DaveRandom I made some changes based on your feedback in the squash branch. Have a look at the commits I made today and let me know what you think. /cc @prolic |
|
@trowski that seems like a reasonable change, yes. I'm a little surprised tbh, I was expecting |
|
@DaveRandom It sounds like the listen command doesn't take affect until after the transaction is committed? I can do that too I guess… but I will have to keep the connection busy while the listener is active (i.e., the |
|
@trowski pragmatically, it might be better to just not support listen/notify in transactions, at least for now, Using them in a transaction is functionally identical to changing the logic such that they are called on successful commit, which seems easy to accomplish in app code and avoids what seems like a lot of complexity in the library code to make this interact sanely with a pool. Doing so initially would not preclude adding the functionality later in a backwards-compatible, if the interface structure is done right, Just a thought, possibly not a great one :-P |
|
I think this can be closed now? Will you update mysql as well, soon? |
|
@prolic I can close this now without merging, right? |
|
Yes, it's already merged with rebased branch. |
See also here: https://github.com/prolic/sql
(We would need to move the repo to amphp organization)
If I missed something, let me know please.