Skip to content

Commit

Permalink
fix: ConnectionOptions conflict between mysql and mysql/promise (
Browse files Browse the repository at this point in the history
  • Loading branch information
wellwelwel authored Apr 16, 2023
1 parent 665697d commit eca8bda
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 0 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
Connection as PromiseConnection,
Pool as PromisePool,
PoolConnection as PromisePoolConnection,
} from './promise';

Expand Down Expand Up @@ -71,7 +70,6 @@ export interface Connection extends mysql.Connection {
) => any
): mysql.Query;
ping(callback?: (err: mysql.QueryError | null) => any): void;
promise(promiseImpl?: PromiseConstructor): PromiseConnection;
unprepare(sql: string): mysql.PrepareStatementInfo;
prepare(sql: string, callback?: (err: mysql.QueryError | null, statement: mysql.PrepareStatementInfo) => any): mysql.Prepare;
serverHandshake(args: any): any;
Expand Down Expand Up @@ -157,7 +155,6 @@ export interface Pool extends mysql.Connection {
on(event: 'acquire', listener: (connection: PoolConnection) => any): this;
on(event: 'release', listener: (connection: PoolConnection) => any): this;
on(event: 'enqueue', listener: () => any): this;
promise(promiseImpl?: PromiseConstructor): PromisePool;
unprepare(sql: string): mysql.PrepareStatementInfo;
prepare(sql: string, callback?: (err: mysql.QueryError | null, statement: mysql.PrepareStatementInfo) => any): mysql.Prepare;

Expand Down
5 changes: 4 additions & 1 deletion typings/mysql/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import BasePrepare = require('./lib/protocol/sequences/Prepare');
import {QueryOptions, StreamOptions, QueryError} from './lib/protocol/sequences/Query';
import {PrepareStatementInfo} from './lib/protocol/sequences/Prepare';
import Server = require('./lib/Server');
import { Pool as PromisePool } from '../../promise';

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

// Expose class interfaces
export interface Connection extends BaseConnection {}
export interface Connection extends BaseConnection {
promise(promiseImpl?: PromiseConstructor): PromisePool;
}
export interface PoolConnection extends BasePoolConnection {}
export interface Pool extends BasePool {}
export interface PoolCluster extends BasePoolCluster {}
Expand Down
2 changes: 0 additions & 2 deletions typings/mysql/lib/Connection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,6 @@ declare class Connection extends EventEmitter {
unprepare(sql: string): any;

serverHandshake(args: any): any;

promise(): Promise<Connection>;
}

export = Connection;

0 comments on commit eca8bda

Please sign in to comment.