Skip to content

Commit ab7fc05

Browse files
committed
fix example: async/await createPool(conn), conn was missing
1 parent 7b4f535 commit ab7fc05

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ es7 async/await:
5757
let mysql = require('mysql2/promise');
5858
let conn = await mysql.createConnection({ database: test });
5959
let [rows, fields] = await conn.execute('select ?+? as sum', [2, 2]);
60-
let pool = mysql.createPool();
60+
let pool = mysql.createPool(conn);
6161
// execute in parallel, next console.log in 3 seconds
6262
await Promise.all([pool.query('select sleep(2)'), pool.query('select sleep(3)')]);
6363
console.log('3 seconds after');
@@ -105,7 +105,7 @@ var conn = mysql.createConnection({
105105
// continue handshake by sending response data
106106
// respond with error to propagate error to connect/changeUser handlers
107107
cb(null, response);
108-
})
108+
})
109109
}
110110
}
111111
});

0 commit comments

Comments
 (0)