Skip to content

Broken pool.query for 2-arity #872

@ghost

Description

Hi! I noticed that the following lines of code have been removed from the pool.query function between v2.3.2 and v2.4.0:

  if (typeof values === 'function') {
    cb = values;
    values = null;
  }

  if (!cb) {
    // Ignore results and errors if no cb supplied; matches connection.query
    cb = function () {};
  }

As a result, in v2.4.0, when I attempt to call pool.query with only two parameters --- a sql query and a callback function, my code breaks.

Was this an intentional change, in which case, I need to use explicit null values when calling the function, or is this something that you can fix? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions