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

READABLE from COPY does not recieve close event #917

Open
Ivor808 opened this issue Jul 23, 2024 · 0 comments
Open

READABLE from COPY does not recieve close event #917

Ivor808 opened this issue Jul 23, 2024 · 0 comments

Comments

@Ivor808
Copy link

Ivor808 commented Jul 23, 2024

I am using a postgres client to run COPY on the server to stdout into a readable stream. I am using pipeline and noticing that sometimes pipeline hangs indefinetly due to the readabel stream never getting the 'close' event. I provided sample code below. I'm trying to read the output of copy to a local file.

await pipeline(
          await sourceSql`COPY (${sourceSql.unsafe(
      'select * from test where id = ' +
        id
    )}) to stdout WITH (FORMAT CSV, NULL "NULL", HEADER)`.readable();,
          createWriteStream(
            `${os.homedir()}/cms/${testName}`
          )
        );
      }
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

No branches or pull requests

1 participant