@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
39 lines (24 loc) • 1.51 kB
Markdown
---
lang: en
title: 'API docs: repository.defaultcrudrepository.execute_2'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.defaultcrudrepository.execute_2.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/repository](./repository.md) > [DefaultCrudRepository](./repository.defaultcrudrepository.md) > [execute](./repository.defaultcrudrepository.execute_2.md)
## 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.
<b>Signature:</b>
```typescript
execute(...args: PositionalParameters): Promise<AnyObject>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| args | [PositionalParameters](./repository.positionalparameters.md) | Command and parameters, please consult your connector's documentation to learn about supported commands and their parameters. |
<b>Returns:</b>
Promise<[AnyObject](./repository.anyobject.md)<!-- -->>
A promise which resolves to the command output as returned by the database driver.