question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, I was wondering if someone could help me with a simple stream example? I’ve tried the following, which appears to be as simple as it gets, but my output file doesn’t contain any data:

    const stringifier = Stringify();
    Knex.select('*').from('business')
        .stream()
        .pipe(stringifier)
        .pipe(Fs.createWriteStream('out.csv'));

stringifier uses the node-csv-stringify package.

I’m sure I’m probably missing something here, but can’t seem to get this to work.

I’m using Knex 0.13, Node 7.8.0 and Postgres 9.5

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

7reactions
kfurnesscommented, Aug 8, 2018

I believe that you need to install node-pg-query-stream for knex streaming to work.

6reactions
Crusader4Christcommented, Jun 10, 2020

@mlarcher what about mysql?

Read more comments on GitHub >

github_iconTop Results From Across the Web

10 Examples of Stream API in Java 8 - count + filter + map + ...
Here is an example of counting how many elements are in the stream at any stage of pipeline processing using the count() method...
Read more >
The Java 8 Stream API Tutorial - Baeldung
The article is an example-heavy introduction of the possibilities and operations offered by the Java 8 Stream API.
Read more >
Java 8 Stream - javatpoint
Java 8 Stream with examples and topics on functional interface, anonymous class, lambda for list, lambda for comparable, default methods, method reference, ...
Read more >
A Guide to Java Streams in Java 8: In-Depth Tutorial ... - Stackify
This in-depth tutorial is an introduction to the many functionalities supported by streams, with a focus on simple, practical examples.
Read more >
Java Stream API (with Examples) - HowToDoInJava
In Java 8, Stream can be defined as a sequence of elements from a source such as a collection or array. Learn about...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found