-
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
feat(postgres): WIP implement COPY FROM/TO STDIN
#491
Conversation
56b7d55
to
a74c414
Compare
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. |
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.
I need to actually handle this.
|
||
match conn.stream.recv().await { | ||
Ok(msg) => Err(err_protocol!( | ||
"fail_with: expected ErrorResponse, got: {:?}", |
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.
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(()), |
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.
We shouldn't merge until this is fixed.
conn.wait_until_ready().await?; | ||
conn.stream.send(Query(statement)).await?; | ||
|
||
let _: CopyResponse = conn |
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.
Not sure if or how we want to make this available for inspection by the user.
Closing to clear up the PR queue but note that @abonander is still planning to work on this in the near future. |
@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. |
closes #36