Skip to content

require('pg').native doesn't work with query row event #743

Description

@adayton1

If I uncomment the query.on('row'...) section below, node complains that the function addRow does not exist. When I just use require('pg') it works properly.

var pg = require('pg').native;

pg.connect(connectionString, function(err, client, done) {

    if (err) {
        console.error(err);
    }

    var query = client.query(queryString, params);

    query.on('error', function(err) {
        console.error(err);
    });

    /*query.on('row', function(row, result) {
        result.addRow(row);
    });*/

    query.on('end', function(result) {
        done();
    });
});

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions