Skip to Content
Pulpfixer 2
DocumentationAPI ReferenceTypesDbFunctionsFunction: db()

pulpfixer v1.4.21


Function: db()

db(connectionName): Promise<DatabaseInstance>

Create a database instance for a given connection name

Parameters

connectionName

string

{string}

Returns

Promise<DatabaseInstance>

Example

const sql = await db('production'); // production is the connection name const result = await sql.query('SELECT * FROM users where id = ?', [ 1 ]);
Last updated on