Skip to content

egon-orm-workspace / @egon-orm/mysql / MysqlOptions

Interface: MysqlOptions ​

Defined in: mysql/src/options.ts:46

The options of mysql. Every option may also be given as undefined, which is the same as leaving it out (connectionString: process.env.DATABASE_URL).

Connect with connectionString, or with host, port, user, password, database and ssl, or both (the separate settings win). There is no time zone option: the session is always UTC.

Example ​

ts
const options: MysqlOptions = {
  connectionString: process.env.DATABASE_URL,
  pool: { max: 10, idleTimeoutMs: 30_000, connectionTimeoutMs: 5_000 },
};

Properties ​

connectionString? ​

ts
readonly connectionString?: string;

Defined in: mysql/src/options.ts:48

A mysql:// URL.


database? ​

ts
readonly database?: string;

Defined in: mysql/src/options.ts:53


host? ​

ts
readonly host?: string;

Defined in: mysql/src/options.ts:49


password? ​

ts
readonly password?: string;

Defined in: mysql/src/options.ts:52


planCacheSize? ​

ts
readonly planCacheSize?: number;

Defined in: mysql/src/options.ts:59

How many compiled query shapes the adapter keeps. Default 1,000.


pool? ​

ts
readonly pool?: MysqlPoolOptions;

Defined in: mysql/src/options.ts:57

Settings for the pool the adapter creates.


port? ​

ts
readonly port?: number;

Defined in: mysql/src/options.ts:50


ssl? ​

ts
readonly ssl?: string | SslOptions;

Defined in: mysql/src/options.ts:55

TLS options for node:tls, or a profile name mysql2 knows.


user? ​

ts
readonly user?: string;

Defined in: mysql/src/options.ts:51