@@ -32,7 +32,7 @@ export async function execute(
32
32
) ;
33
33
}
34
34
let connector : Connector ;
35
- let pool : pg . Pool ;
35
+ let client : pg . Client ;
36
36
switch ( user . type ) {
37
37
case "CLOUD_IAM_USER" : {
38
38
connector = new Connector ( {
@@ -43,11 +43,10 @@ export async function execute(
43
43
ipType : IpAddressTypes . PUBLIC ,
44
44
authType : AuthTypes . IAM ,
45
45
} ) ;
46
- pool = new pg . Pool ( {
46
+ client = new pg . Client ( {
47
47
...clientOpts ,
48
48
user : opts . username ,
49
49
database : opts . databaseId ,
50
- max : 1 ,
51
50
} ) ;
52
51
break ;
53
52
}
@@ -61,11 +60,10 @@ export async function execute(
61
60
ipType : IpAddressTypes . PUBLIC ,
62
61
authType : AuthTypes . IAM ,
63
62
} ) ;
64
- pool = new pg . Pool ( {
63
+ client = new pg . Client ( {
65
64
...clientOpts ,
66
65
user : opts . username ,
67
66
database : opts . databaseId ,
68
- max : 1 ,
69
67
} ) ;
70
68
break ;
71
69
}
@@ -81,12 +79,11 @@ export async function execute(
81
79
instanceConnectionName : connectionName ,
82
80
ipType : IpAddressTypes . PUBLIC ,
83
81
} ) ;
84
- pool = new pg . Pool ( {
82
+ client = new pg . Client ( {
85
83
...clientOpts ,
86
84
user : opts . username ,
87
85
password : opts . password ,
88
86
database : opts . databaseId ,
89
- max : 1 ,
90
87
} ) ;
91
88
break ;
92
89
}
@@ -96,13 +93,13 @@ export async function execute(
96
93
for ( const s of sqlStatements ) {
97
94
logFn ( `Executing: '${ s } '` ) ;
98
95
try {
99
- await pool . query ( s ) ;
96
+ await client . query ( s ) ;
100
97
} catch ( err ) {
101
98
throw new FirebaseError ( `Error executing ${ err } ` ) ;
102
99
}
103
100
}
104
101
105
- await pool . end ( ) ;
102
+ await client . end ( ) ;
106
103
connector . close ( ) ;
107
104
}
108
105
0 commit comments