Page Contents

Home > @loopback/repository > DefaultCrudRepository > execute

DefaultCrudRepository.execute() method

Execute a raw database command using a connector that’s not described by LoopBack’s execute API yet.

**WARNING:** In general, it is always better to perform database actions through repository methods. Directly executing database commands may lead to unexpected results and other issues.

Signature:

execute(...args: PositionalParameters): Promise<AnyObject>;

Parameters

Parameter Type Description
args PositionalParameters Command and parameters, please consult your connector’s documentation to learn about supported commands and their parameters.

Returns:

Promise<AnyObject>

A promise which resolves to the command output as returned by the database driver.