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

feat(pg): enable COPY FROM STDIN #110

Merged
merged 10 commits into from
Nov 7, 2024
Merged

feat(pg): enable COPY FROM STDIN #110

merged 10 commits into from
Nov 7, 2024

Conversation

fanyang01
Copy link
Collaborator

@fanyang01 fanyang01 commented Nov 1, 2024

This PR adds support for PostgreSQL's COPY FROM STDIN command.

$ psql -h 127.0.0.1 -U mysql db01

db01=> \copy t from './t.csv' WITH DELIMITER ',' CSV HEADER;
COPY 12
db01=> select * from t;
 id |  s   |  j
----+------+------
 11 | aa   |   12
 12 | bb   |   23
 13 | cc   |   34
 14 | dd   |   45
 15 | ee   |   56
 16 | ff   |   67
 17 | gg   |   78
 18 | hh   |   89
 19 | ii   |  100
 20 | jj   | 1011
 21 | k\tk | 1213
 22 | l\tl | 1415

@fanyang01 fanyang01 marked this pull request as ready for review November 6, 2024 11:38
@TianyuZhang1214
Copy link
Contributor

How about adding some tests for this feature?

@fanyang01
Copy link
Collaborator Author

@TianyuZhang1214 Done. I have added a basic test. In the next step, we should introduce some sqllogictest-like tools.

Copy link
Contributor

@TianyuZhang1214 TianyuZhang1214 left a comment

Choose a reason for hiding this comment

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

LGTM!

@fanyang01 fanyang01 merged commit b84c3e2 into main Nov 7, 2024
2 checks passed
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.

2 participants