ext/pdo_pgsql: Expanding COPY input from an array to an iterable - #15893
Closed
KentarouTakeda wants to merge 3 commits into
Closed
KentarouTakeda wants to merge 3 commits into
KentarouTakeda wants to merge 3 commits into
Conversation
KentarouTakeda
force-pushed
the
pdo-pgsql-copy-from-iterable
branch
from
September 15, 2024 08:36
658d696 to
36ff68d
Compare
KentarouTakeda
marked this pull request as ready for review
September 15, 2024 08:39
KentarouTakeda
requested review from
SakiTakamachi,
devnexen and
kocsismate
as code owners
September 15, 2024 08:39
Member
|
Nice feature and qualifies for the next major release I think. looking ok overall, I would suggest trying to refactor, as much as you can, common code between the two modes. |
Contributor
Author
|
I'll try it. |
KentarouTakeda
marked this pull request as draft
September 15, 2024 09:04
KentarouTakeda
force-pushed
the
pdo-pgsql-copy-from-iterable
branch
from
September 15, 2024 10:17
36ff68d to
e141a5e
Compare
KentarouTakeda
force-pushed
the
pdo-pgsql-copy-from-iterable
branch
from
September 15, 2024 10:55
e141a5e to
5691fb3
Compare
Contributor
Author
|
I tried to do as much as I could. |
KentarouTakeda
marked this pull request as ready for review
September 15, 2024 10:58
Member
|
Couple of things to look at I think, good news is because of this
you have the time. see next comments. |
devnexen
reviewed
Sep 15, 2024
devnexen
reviewed
Sep 15, 2024
devnexen
reviewed
Sep 15, 2024
Member
|
Looking good to me, implementation-wise. I ll let it rest if someone wants to chime in about tests. |
devnexen
approved these changes
Sep 28, 2024
devnexen
added a commit
to devnexen/php-src
that referenced
this pull request
Sep 30, 2024
inspired from the Pdo\Pgsql new feature phpGH-15893.
devnexen
added a commit
to devnexen/php-src
that referenced
this pull request
Oct 1, 2024
jorgsowa
pushed a commit
to jorgsowa/php-src
that referenced
this pull request
Oct 1, 2024
jorgsowa
pushed a commit
to jorgsowa/php-src
that referenced
this pull request
Oct 1, 2024
inspired from the Pdo\Pgsql new feature phpGH-15893. close phpGH-16124
devnexen
added a commit
that referenced
this pull request
Oct 3, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request allows
PDO::pgsqlCopyFromArrayto acceptIterableinstead of justarray. This is not a breaking change since it still acceptsarray.The PostgreSQL
COPYstatement is a great interface. We can bulk insert a set of records by inputting them as CSV or TSV. PostgreSQL also supports processing them as a stream.However, the current
pgsqlCopyFromArraydoes not take full advantage of this capability. It requires that the records to be inserted be input as a single array, so it cannot be processed by piping external input to PostgreSQL'sCOPY.This weakness will be overcome by supporting not only simple arrays but also
TraversableandGenerator.