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(postgres): WIP implement COPY FROM/TO STDIN #491

Closed
wants to merge 1 commit into from

Conversation

abonander
Copy link
Collaborator

closes #36

Signed-off-by: Austin Bonander <austin@launchbadge.com>
/// [in this StackOverflow answer](https://stackoverflow.com/a/35319598).
///
/// If you don't read the stream to completion, the next time the connection is used it will
/// need to read and discard all the remaining queued data, which could take some time.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I need to actually handle this.


match conn.stream.recv().await {
Ok(msg) => Err(err_protocol!(
"fail_with: expected ErrorResponse, got: {:?}",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Need to update this error message.

msg.format
)),
// FIXME: inspect the `DatabaseError` to make sure we're not discarding another error
Err(Error::Database(_db)) => Ok(()),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We shouldn't merge until this is fixed.

conn.wait_until_ready().await?;
conn.stream.send(Query(statement)).await?;

let _: CopyResponse = conn
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if or how we want to make this available for inspection by the user.

@mehcode mehcode added this to the 0.5 milestone Jul 27, 2020
@mehcode
Copy link
Member

mehcode commented Nov 12, 2020

Closing to clear up the PR queue but note that @abonander is still planning to work on this in the near future.

@mehcode mehcode closed this Nov 12, 2020
@skreborn
Copy link

@abonander Sorry to bug; is there a reason this hasn't progressed further in the past year or so, or has it just not been a priority? I would greatly appreciate the inclusion of this feature for a project I'm actively working on.

@abonander abonander deleted the ab/pg-copy branch July 11, 2022 20:13
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.

Add support for COPY ... FROM STDIN and COPY ... TO STDOUT statements in PostgreSQL
3 participants