File tree Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Expand file tree Collapse file tree 3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { mysql } from '../../../index' ;
2
+ import { access } from '../../baseConnection' ;
3
+
4
+ const pool = mysql . createPool ( access ) ;
5
+
6
+ pool . getConnection ( ( err , conn ) => {
7
+ try {
8
+ // @ts -expect-error: The connection can't get another connection
9
+ conn . getConnection ( ) ;
10
+ } catch ( err ) {
11
+ console . log ( 'This error is expected' , err ) ;
12
+ }
13
+ } ) ;
Original file line number Diff line number Diff line change
1
+ import { mysql } from '../../../index' ;
2
+ import { access } from '../../baseConnection' ;
3
+
4
+ ( async ( ) => {
5
+ const pool = mysql . createPool ( access ) ;
6
+ const conn = await pool . promise ( ) . getConnection ( ) ;
7
+
8
+ try {
9
+ // @ts -expect-error: The connection can't get another connection
10
+ conn . getConnection ( ) ;
11
+ } catch ( err ) {
12
+ console . log ( 'This error is expected' , err ) ;
13
+ }
14
+ } ) ( ) ;
Original file line number Diff line number Diff line change
1
+ import { mysqlp as mysql } from '../../index' ;
2
+ import { access } from '../baseConnection' ;
3
+
4
+ ( async ( ) => {
5
+ const pool = mysql . createPool ( access ) ;
6
+ const conn = await pool . getConnection ( ) ;
7
+
8
+ conn . connection ;
9
+
10
+ try {
11
+ // @ts -expect-error: The connection can't get another connection
12
+ conn . getConnection ( ) ;
13
+ } catch ( err ) {
14
+ console . log ( 'This error is expected' , err ) ;
15
+ }
16
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments