CodeFoodPixels / node-promise-mysql

A wrapper for mysqljs/mysql that wraps function calls with Bluebird promises.
MIT License
338 stars 64 forks source link

createConnection() does not accept url string #139

Closed torotake closed 3 years ago

torotake commented 3 years ago

createConnection() does not accept url string.

For example: let connection = await mysql.createConnection('mysql://user:pass@host/db?timezone=-0900')

error:

TypeError: Cannot create property 'reconnect' on string 'mysql://user:pass@host/db?timezone=-0900'
    at new connection (/var/task/node_modules/promise-mysql/lib/connection.js:34:30)
    at Object.exports.createConnection (/var/task/node_modules/promise-mysql/index.js:6:12)

Do you have any plans to support url string?

CodeFoodPixels commented 3 years ago

This should work in 4.1.4