We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The CopyStreamQuery class exposes a property rowCount which does not appear to work correctly. Here's a slightly modified example from the readme:
CopyStreamQuery
rowCount
var fs = require('fs'); var pg = require('pg'); var copyFrom = require('pg-copy-streams').from; pg.connect("postgres://...", function(err, client, done) { client.query("CREATE TABLE IF NOT EXISTS my_table (col1 INT, col2 INT, col3 INT)"); copyQuery = copyFrom('COPY my_table FROM STDIN'); var stream = client.query(copyQuery); var fileStream = fs.createReadStream('some_file.tsv') fileStream.pipe(stream).on('finish', function() { console.log('rowCount: %d', copyQuery.rowCount); process.exit(); }); });
I prepared some_file.tsv with 4 rows. The output is rowCount: 1. The data passing through CopyStreamQuery._transform is
some_file.tsv
rowCount: 1
CopyStreamQuery._transform
<Buffer 31 09 32 09 33 0a 34 09 35 09 36 0a 37 09 38 09 39 0a 31 30 09 31 31 09 31 32 0a> i.e. the contents of the entire some_file.tsv: 1 2 3 4 5 6 7 8 9 10 11 12
I can split my inbound stream on line breaks, but, unless I do, the rowCount feature seems to not be working as intended.
The text was updated successfully, but these errors were encountered:
Closed by #37
Sorry, something went wrong.
No branches or pull requests
The
CopyStreamQuery
class exposes a propertyrowCount
which does not appear to work correctly. Here's a slightly modified example from the readme:I prepared
some_file.tsv
with 4 rows. The output isrowCount: 1
. The data passing throughCopyStreamQuery._transform
isI can split my inbound stream on line breaks, but, unless I do, the
rowCount
feature seems to not be working as intended.The text was updated successfully, but these errors were encountered: