Skip to content

Commit eca8bda

Browse files
authored
fix: ConnectionOptions conflict between mysql and mysql/promise (#1955)
1 parent 665697d commit eca8bda

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

index.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
Connection as PromiseConnection,
3-
Pool as PromisePool,
43
PoolConnection as PromisePoolConnection,
54
} from './promise';
65

@@ -71,7 +70,6 @@ export interface Connection extends mysql.Connection {
7170
) => any
7271
): mysql.Query;
7372
ping(callback?: (err: mysql.QueryError | null) => any): void;
74-
promise(promiseImpl?: PromiseConstructor): PromiseConnection;
7573
unprepare(sql: string): mysql.PrepareStatementInfo;
7674
prepare(sql: string, callback?: (err: mysql.QueryError | null, statement: mysql.PrepareStatementInfo) => any): mysql.Prepare;
7775
serverHandshake(args: any): any;
@@ -157,7 +155,6 @@ export interface Pool extends mysql.Connection {
157155
on(event: 'acquire', listener: (connection: PoolConnection) => any): this;
158156
on(event: 'release', listener: (connection: PoolConnection) => any): this;
159157
on(event: 'enqueue', listener: () => any): this;
160-
promise(promiseImpl?: PromiseConstructor): PromisePool;
161158
unprepare(sql: string): mysql.PrepareStatementInfo;
162159
prepare(sql: string, callback?: (err: mysql.QueryError | null, statement: mysql.PrepareStatementInfo) => any): mysql.Prepare;
163160

typings/mysql/index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import BasePrepare = require('./lib/protocol/sequences/Prepare');
1212
import {QueryOptions, StreamOptions, QueryError} from './lib/protocol/sequences/Query';
1313
import {PrepareStatementInfo} from './lib/protocol/sequences/Prepare';
1414
import Server = require('./lib/Server');
15+
import { Pool as PromisePool } from '../../promise';
1516

1617
export function createConnection(connectionUri: string): Connection;
1718
export function createConnection(config: BaseConnection.ConnectionOptions): Connection;
@@ -39,7 +40,9 @@ export {
3940
export * from './lib/protocol/packets/index';
4041

4142
// Expose class interfaces
42-
export interface Connection extends BaseConnection {}
43+
export interface Connection extends BaseConnection {
44+
promise(promiseImpl?: PromiseConstructor): PromisePool;
45+
}
4346
export interface PoolConnection extends BasePoolConnection {}
4447
export interface Pool extends BasePool {}
4548
export interface PoolCluster extends BasePoolCluster {}

typings/mysql/lib/Connection.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ declare class Connection extends EventEmitter {
290290
unprepare(sql: string): any;
291291

292292
serverHandshake(args: any): any;
293-
294-
promise(): Promise<Connection>;
295293
}
296294

297295
export = Connection;

0 commit comments

Comments
 (0)