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
> The `@types/node` ensure the proper interaction between **TypeScript** and the **Node.js** modules used by **MySQL2** (*net*, *events*, *stream*, *tls*, etc.).
10
10
11
-
## Import
11
+
## Usage
12
12
You can import **MySQL2** in two ways:
13
+
- By setting the `esModuleInterop` option to `true` in `tsconfig.json`
13
14
```ts
14
-
import*asmysqlfrom'mysql2';
15
-
import*asmysqlfrom'mysql2/promise';
16
-
17
-
// By setting the `esModuleInterop` option to `true` in `tsconfig.json`
18
15
importmysqlfrom'mysql2';
19
16
importmysqlfrom'mysql2/promise';
20
17
```
21
18
22
-
## Connection
19
+
- By setting the `esModuleInterop` option to `false` in `tsconfig.json`
By performing a **Call Procedure** using `INSERT`, `UPDATE`, etc., the return will be a `ProcedureCallPacket<ResultSetHeader>` (even if you perform multiples queries and set `multipleStatements` to `true`).
237
240
238
241
> For `CREATE PROCEDURE` and `DROP PROCEDURE`, these returns will be the *default*`ResultSetHeader`.
0 commit comments