Class: MysqlClient

MysqlClient

A MySQL client you can use to execute queries against MySQL


new MysqlClient()

Methods


runInTransaction(readonly, func)

Runs a function in a transaction. The function must receive one parameter that will be of class {MysqlTransaction} and that you need to use to run all queries in this transaction

Parameters:
Name Type Description
readonly boolean

Whether the transaction needs to be readonly or not

func function

A function that returns a promise that will execute all the queries wanted in this transaction

Returns:

A promise that will execute the whole transaction

Type
Promise