Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

allowPublicKeyRetrieval?: boolean

Indicate that if rsaPublicKey or cachingRsaPublicKey public key are not provided, if client can ask server to send public key. default: false

arrayParenthesis?: boolean

Indicate if array are included in parenthesis. This option permit compatibility with version < 2.5

autoJsonMap?: boolean

indicate if JSON fields for MariaDB server 10.5.2+ results in JSON format (or String if disabled)

bigIntAsNumber?: boolean

Force returning BIGINT data as Number in place of BigInt.

Default: false;

bulk?: boolean

disabled bulk command in batch.

cachingRsaPublicKey?: string

Indicate path/content to MySQL server caching RSA public key. use requires Node.js v11.6+

charset?: string

Protocol character set used with the server. Connection collation will be the default collation associated with charset. It's mainly used for micro-optimizations. The default is often sufficient. example 'UTF8MB4', 'CP1250'. (default 'UTF8MB4')

checkDuplicate?: boolean

indicate to throw an exception if result-set will not contain some data due to having duplicate identifier (Default: true)

collation?: string

Permit to defined collation used for connection. This will defined the charset encoding used for exchanges with database and defines the order used when comparing strings. It's mainly used for micro-optimizations (Default: 'UTF8MB4_UNICODE_CI')

compress?: boolean

Compress exchanges with database using gzip. This can give you better performance when accessing a database in a different location. (Default: false)

connectAttributes?: any

When enabled, sends information during connection to server

  • client name
  • version
  • operating system
  • Node.js version

If JSON is set, add JSON key/value to those values.

When Performance Schema is enabled, server can display client information on each connection.

connectTimeout?: number

The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 1000)

database?: string

Name of the database to use for this connection

dateStrings?: boolean

Whether to retrieve dates as strings or as Date objects.

debug?: boolean

This will print all incoming and outgoing packets on stdout. (Default: false)

debugCompress?: boolean

This will print all incoming and outgoing compressed packets on stdout. (Default: false)

debugLen?: number

When debugging, maximum packet length to write to console. (Default: 256)

decimalAsNumber?: boolean

force returning decimal values as Number in place of String

Default: false;

forceVersionCheck?: boolean

Force server version check by explicitly using SELECT VERSION(), not relying on server initial packet. (Default: false)

foundRows?: boolean

When enabled, the update number corresponds to update rows. When disabled, it indicates the real rows changed.

host?: string

The hostname of the database you are connecting to. (Default: localhost)

initSql?: string | string[]

When a connection is established, permit to execute commands before using connection

insertIdAsNumber?: boolean

force returning insertId as Number in place of BigInt

Default: false;

keepAliveDelay?: number

permit to enable socket keep alive, setting delay. 0 means not enabled. Keep in mind that this don't reset server @@wait_timeout (use pool option idleTimeout for that). in ms (Default: 0)

logPackets?: boolean

Debug option : permit to save last exchanged packet. Error messages will display those last exchanged packet.

(Default: false)

logger?: LoggerConfig

Configure logger

maxAllowedPacket?: number

permit to indicate server global variable max_allowed_packet value to ensure efficient batching. default is 4Mb. see batch documentation

multipleStatements?: boolean

Allow multiple mysql statements per query. Be careful with this, it exposes you to SQL injection attacks. (Default: false)

namedPlaceholders?: boolean

Allows the use of named placeholders.

nestTables?: string | boolean

Presents result-sets by table to avoid results with colliding fields. See the query() description for more information.

password?: string

The password of that MySQL user

permitLocalInfile?: boolean

Allows the use of LOAD DATA INFILE statements. Loading data from a file from the client may be a security issue, as a man-in-the-middle proxy server can change the actual file the server loads. Being able to execute a query on the client gives you access to files on the client. (Default: false)

permitSetMultiParamEntries?: boolean

Compatibility option to permit setting multiple value by a JSON object to replace one question mark. key values will replace the question mark with format like key1=val,key2='val2'. Since it doesn't respect the usual prepared statement format that one value is for one question mark, this can lead to incomprehension, even if badly use to possible injection.

pipelining?: boolean

Sends queries one by one without waiting on the results of the previous entry. (Default: true)

port?: number

The port number to connect to. (Default: 3306)

prepareCacheLength?: number

Indicate prepare cache size when using prepared statement

default to 256.

rowsAsArray?: boolean

Return result-sets as array, rather than a JSON object. This is a faster way to get results

rsaPublicKey?: string

Indicate path/content to MySQL server RSA public key. use requires Node.js v11.6+

sessionVariables?: any

Permit to set session variables when connecting. Example: sessionVariables:{'idle_transaction_timeout':10000}

socketPath?: string

The path to a unix domain socket to connect to. When used host and port are ignored

socketTimeout?: number

Socket timeout in milliseconds after the connection is established

ssl?: boolean | SecureContextOptions & { rejectUnauthorized?: boolean }

object with ssl parameters or a boolean to enable ssl without setting any other ssl option. see https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/connection-options.md#ssl for more information

timeout?: number

Allows timeout for command execution.

timezone?: string

Forces use of the indicated timezone, rather than the current Node.js timezone. Possible values are Z for UTC, local or ±HH:MM format

trace?: boolean

Adds the stack trace at the time of query creation to the error stack trace, making it easier to identify the part of the code that issued the query. Note: This feature is disabled by default due to the performance cost of stack creation. Only turn it on when you need to debug issues. (Default: false)

typeCast?: TypeCastFunction

Allows to cast result types.

user?: string

The MySQL user to authenticate as

Methods

  • stream(callback?: ((err?: Error, stream?: Duplex) => void)): void
  • Permit to set stream.

    Parameters

    • Optional callback: ((err?: Error, stream?: Duplex) => void)
        • (err?: Error, stream?: Duplex): void
        • Parameters

          • Optional err: Error
          • Optional stream: Duplex

          Returns void

    Returns void

Generated using TypeDoc