Skip to content

ConnectionPromises.Function.connect

Christian d'Heureuse edited this page Oct 15, 2026 · 1 revision

tedious-plus / ConnectionPromises / connect

Function: connect()

function connect(connection): Promise<void>;

Defined in: ConnectionPromises.ts:192

Opens a connection to the database server.

This is the promisified version of Connection.connect().

This function registers a permanent listener for the error event of the connection. Therefore, unlike with plain Tedious, a fatal connection error does not crash the process when the application has not registered its own error listener. Instead, the error is thrown by the next function of this module that is called for the connection.

Parameters

connection

Connection

A newly created Tedious connection that has not yet been connected.

Returns

Promise<void>

A promise that is resolved when the connection has been established and the login has completed.

Clone this wiki locally