sidorares / sidorares/node-mysql2

unable to end the mysql connection using the mysql2 promise

Open
#561 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.4k
Forks
680
Avg merge
9h 7m
Merged PRs (30d)
59

Description

Followings are my piece of code, please have a look into it.

var mysql = require('promise-mysql');
            var connection;

            mysql.createConnection({host:'Ip', user:'qa', password: '******'}).then(function(conn){
                connection = conn;
                return connection.query(firstInput);
            })
                .then(function(rows){
 console.log(rows);
})
                .then(function(){
                console.log("End of DB Con.");
                return connection.end();
                
            })
                .catch(function(error){
                //logs out the error
                console.log(error);
            });

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue only provides a JavaScript promise-mysql connection chain; no repository file, test, or entry point is named. Start by reproducing the connection and end sequence from the example, then inspect the mysql2 promise connection API and existing connection-close tests if present. Done means the reported inability to end the connection is reproduced, explained, and covered by a passing regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mysql
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.