Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
Discern point of failure in multi-param query with node-sqlite3

In a Node.js server application I am trying to select a row through the .get() method filtering the result with a WHERE clause with multiple parameters.

function getRowByID(paramA, paramB, paramC) {
    return new Promise(function(resolve, reject) {
        const query = 'SELECT * FROM myTable WHERE a=? AND b=? AND c=?'
        db.get(query, [paramA, paramB, paramC], (err, row) => {
            if (err) reject(err)
            else {
                // check contents of rows and resolve
            }
        })
    })
}

According to the node-sqlite3 API documentation if the result set is empty, the second parameter (row) of the callback is undefined. This unfortunately doesn't give me any information, how can I understand which parameter was the cause of the result being empty? Could there be workarounds to the problem I am having, like - for example - splitting the query in different sequential promises?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!