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
I'm using mysql2 with Promise by const mysql2 = require("mysql2/promise").
But when I started to make a Pool by mysql2.createPool method, my IDE recognize that method type is from export function createPool(config: PoolOptions): BasePool;
What I want is to make mysql2.createPool is recognized as type of export function createPool(config: PoolOptions): Pool;
Code is working well, but it annoys me by distracting autocomplete feature.
My IDE says that pool.getConnection() returns void. So, when I start to use other belonging method like await conn.beginTransaction, await conn.query, it warns me, "Unresolved function or method beginTransaction()"
As temporary measure, I did this when making a Pool:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I'm using mysql2 with Promise by
const mysql2 = require("mysql2/promise")
.But when I started to make a Pool by
mysql2.createPool
method, my IDE recognize that method type is fromexport function createPool(config: PoolOptions): BasePool;
What I want is to make
mysql2.createPool
is recognized as type ofexport function createPool(config: PoolOptions): Pool;
Code is working well, but it annoys me by distracting autocomplete feature.
My IDE says that pool.getConnection() returns void. So, when I start to use other belonging method like
await conn.beginTransaction
,await conn.query
, it warns me, "Unresolved function or method beginTransaction()"As temporary measure, I did this when making a Pool:
Now, It works well as I wanted.
I'm currently using Webstorm for IDE. No typescript features using, only vanilla JS.
Beta Was this translation helpful? Give feedback.
All reactions