node-mysql2
node-mysql2 copied to clipboard
types are broken
i use mysql2 like this:
require('dotenv').config({path: __dirname + '/.env'}); const mysql = require('mysql2/promise');
module.exports = mysql.createPool({ "host": process.env.DB_HOST, "user": process.env.DB_USER, "port": parseInt(process.env.NODE_ENV === 'production' ? process.env.DB_PORT_PROD : process.env.DB_PORT_DEV), "password": process.env.DB_PASSWORD, "waitForConnections": process.env.DB_WAIT_FOR_CONNECTIONS === 'true', "connectionLimit": parseInt(process.env.DB_CONNECTION_LIMIT), "queueLimit": parseInt(process.env.DB_QUEUE_LIMIT), "dateStrings": [ "DATE", "DATETIME" ], maxPreparedStatements: 100, jsonStrings: true });
and require it in another file. type hints are not working at all in phpstorm