Skip to content

Commit

Permalink
Merge pull request #1462 from JerrysShan/chore/config
Browse files Browse the repository at this point in the history
chore: export connection config
  • Loading branch information
sidorares committed Dec 20, 2021
2 parents 7af61bd + e6e4a29 commit 6fae0c2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ export interface ConnectionOptions extends mysql.ConnectionOptions {
};
}

export interface ConnectionConfig extends ConnectionOptions {
static mergeFlags(defaultFlags: string[], userFlags: string[] | string): number;
static getDefaultFlags(options?: ConnectionOptions): string[];
static getCharsetNumber(charset: string): number;
static getSSLProfile(name: string): { ca: string[] };
static parseUrl(url: string): { host: string, port: number, database: string, user: string, password: string, [key: string]: any };
}

export interface PoolOptions extends mysql.PoolOptions, ConnectionOptions {}

export function createConnection(connectionUri: string): Connection;
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports.createConnection = function(opts) {

exports.connect = exports.createConnection;
exports.Connection = Connection;
exports.ConnectionConfig = ConnectionConfig;

const Pool = require('./lib/pool.js');
const PoolCluster = require('./lib/pool_cluster.js');
Expand Down

0 comments on commit 6fae0c2

Please sign in to comment.