You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tad late to the party here, but here's how I solved my types.
import*asmysqlfrom'mysql2';import{Connection,Pool}from'mysql2';exportconstcreateConnectionPool=(): Pool=>{returnmysql.createPool(databaseConfig);}// When called I cast it as Connection because Pool extends itconstpool=config.createConnectionPool()asConnection;constdb=pool.promise();
Now the Connection type for db is from mysql2/promise
Hi there,
The function promise() is not available on the Pool class :( !?
Thanks for your help !
The text was updated successfully, but these errors were encountered: