Skip to content

Commit cf88141

Browse files
committed
mysql_clear_password can have string type
- mysql_clear_password in authPlugins currently only supports Promise<string> type. However AWS.RDS.Signer.getAuthToken returns string, which causes type error "Type 'string' is not assignable" - This fix will add support for string type as well
1 parent d74a7d9 commit cf88141

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

index.d.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ export interface Pool extends mysql.Connection {
151151
promise(promiseImpl?: PromiseConstructor): PromisePool;
152152
}
153153

154-
type authPlugins =
155-
(pluginMetadata: { connection: Connection; command: string }) =>
156-
(pluginData: Buffer) => Promise<string>;
154+
type authPlugins = (pluginMetadata: {
155+
connection: Connection;
156+
command: string;
157+
}) => (pluginData: Buffer) => Promise<string> | string;
157158

158159
export interface ConnectionOptions extends mysql.ConnectionOptions {
159160
charsetNumber?: number;
@@ -175,7 +176,7 @@ export interface ConnectionOptions extends mysql.ConnectionOptions {
175176
queueLimit?: number;
176177
waitForConnections?: boolean;
177178
authPlugins?: {
178-
[key: string]: authPlugins;
179+
[key: string]: authPlugins;
179180
};
180181
}
181182

0 commit comments

Comments
 (0)