Skip to content
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
16 changes: 16 additions & 0 deletions test/tsc-build/mysql/createPool/promise/promise.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { mysql, mysqlp } from '../../../index';
import { access } from '../../baseConnection';

(async () => {
let pool: mysql.Pool | null = null;
let promisePool: mysqlp.Pool | null = null;
let conn: mysqlp.PoolConnection | null = null;

if (pool === null) return;

pool = mysql.createPool(access);
promisePool = pool.promise();
conn = await promisePool.getConnection();

conn.release();
})();
4 changes: 2 additions & 2 deletions typings/mysql/lib/Pool.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {OkPacket, RowDataPacket, FieldPacket, ResultSetHeader} from './protocol/
import Connection = require('./Connection');
import PoolConnection = require('./PoolConnection');
import {EventEmitter} from 'events';
import {PoolConnection as PromisePoolConnection} from '../../../promise';
import {Pool as PromisePool} from '../../../promise';

declare namespace Pool {

Expand Down Expand Up @@ -78,7 +78,7 @@ declare class Pool extends EventEmitter {
on(event: string, listener: Function): this;
on(event: 'connection', listener: (connection: PoolConnection) => any): this;

promise(promiseImpl?: PromiseConstructor): PromisePoolConnection;
promise(promiseImpl?: PromiseConstructor): PromisePool;
}

export = Pool;