Getting Mysql2 connection pool
crisward opened this issue · 0 comments
crisward commented
I was using an older version of the mysql library (v2) with node-rate-limiter-flexible
https://github.com/animir/node-rate-limiter-flexible/wiki/MySQL
To configure it I have this line
import connect,{sql} from "@databases/mysql";
const db = connect(process.env.DATABASE_URL)
let connection = {
storeClient:db.pool.pool,
dbName: db.pool.pool.config.connectionConfig.database,
tableName: 'ratelimit'
}
I've recently updated to version 6 and all my tests are passing, apart from those which integrated with this library.
Those above variables are no longer present. I've tried digging through your code to see if I can access the underlying mysql2 connection pool, but I haven't had any luck. I shared this connection with other queries, hence why I'm not using mysql2 directly.
As someone who is more familiar with the code in your library, any ideas if its possible to access this?
Many thanks.