mirror of
https://github.com/knex/knex.git
synced 2025-12-30 00:30:14 +00:00
Add types for connection config of mysql2 driver (#4144)
This commit is contained in:
parent
bad1ea714d
commit
073df48cc6
21
types/index.d.ts
vendored
21
types/index.d.ts
vendored
@ -16,6 +16,7 @@ import ResultTypes = require('./result');
|
||||
import { Tables } from './tables';
|
||||
|
||||
import { ConnectionOptions } from "tls";
|
||||
import { Stream } from "stream";
|
||||
|
||||
// # Generic type-level utilities
|
||||
|
||||
@ -1843,6 +1844,7 @@ declare namespace Knex {
|
||||
| ConnectionConfig
|
||||
| MariaSqlConnectionConfig
|
||||
| MySqlConnectionConfig
|
||||
| MySql2ConnectionConfig
|
||||
| MsSqlConnectionConfig
|
||||
| OracleDbConnectionConfig
|
||||
| PgConnectionConfig
|
||||
@ -1972,6 +1974,25 @@ declare namespace Knex {
|
||||
expirationChecker?(): boolean;
|
||||
}
|
||||
|
||||
// Config object for mysql2: https://github.com/sidorares/node-mysql2/blob/master/lib/connection_config.js
|
||||
// Some options for connection pooling and MySQL server API are excluded.
|
||||
interface MySql2ConnectionConfig extends MySqlConnectionConfig {
|
||||
authPlugins?: {[pluginName: string]: (pluginMetadata: any) => ((pluginData: any) => any)};
|
||||
authSwitchHandler?: (data: any, callback: () => void) => any;
|
||||
charsetNumber?: number;
|
||||
compress?: boolean;
|
||||
connectAttributes?: {[attrNames: string]: any};
|
||||
enableKeepAlive?: boolean;
|
||||
keepAliveInitialDelay?: number;
|
||||
maxPreparedStatements?: number;
|
||||
namedPlaceholders?: boolean;
|
||||
nestTables?: boolean | string;
|
||||
passwordSha1?: string;
|
||||
rowsAsArray?: boolean;
|
||||
stream?: boolean | ((opts: any) => Stream) | Stream;
|
||||
uri?: string;
|
||||
}
|
||||
|
||||
interface OracleDbConnectionConfig {
|
||||
host: string;
|
||||
user: string;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user