Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ConnectionOptions conflict between mysql and mysql/promise #1955

Merged
merged 1 commit into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;