-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[WIP] [3.0] Extract getSequenceNumber() from lastInsertId() #3368
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…having to replicate the \PDOStatement interface in ResultStatement
morozov
force-pushed
the
develop
branch
2 times, most recently
from
February 22, 2019 00:01
3850154
to
4fbe91a
Compare
morozov
force-pushed
the
develop
branch
3 times, most recently
from
March 18, 2019 06:13
a640b82
to
e7b6c16
Compare
morozov
force-pushed
the
develop
branch
3 times, most recently
from
June 27, 2019 06:29
10890d6
to
3836750
Compare
@morozov Same here, has this been implemented elsewhere? |
No. GitHub closed this automatically. |
@BenMorel are you planning to work on this? This is definitely what I'd like to see in 3.0. |
@morozov I'm trying to rebase the relevant commits onto master. There's quite some work do to, but I should get there. We'll see how it goes. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Work In Progress: this requires #3335 and #3367 to be merged first. Their commits are included here; this PR actually starts at commit 69b6f3d.
I'm opening this PR early to be able to run CI tests on all platforms, and will rebase it later.
Summary
While talking about
Driver\Connection::lastInsertId()
, @morozov suggested the idea that:Proposed changes
This PR splits the existing
lastInsertId(?string $name = null) : string
method into 2 methods:lastInsertId() : string
getSequenceNumber(string $name) : string
Naming is a first draft, suggestions welcome (
getLastInsertId()
for consistency?)Tests have been extended to cover the following scenarios:
lastInsertId()
on supported platformslastInsertId()
on unsupported platforms (exception)lastInsertId()
on all platforms, on a fresh connection, i.e. with no ID available (exception)getSequenceNumber()
with a known sequence name on supported platformsgetSequenceNumber()
with an unknown sequence name on all platforms (exception)