---
sidebar_position: 4
---

# Insert

Performs a query to insert new data into a table.

## Methods

### selectDatabase()
&rarr; (`database` = __String__) &rarr; `this`

Selects a different database for this query.

**Parameters**

| Parameter | Type | Description |
| -- | -- | -- |
| `database` | __String__ | Name of the database to select |

**Returns**

&rarr; `this`

***

### data()
&rarr; (`objects` = __Array__\<__Object__\>) &rarr; `this`

The data (rows) to insert.

**Parameters**

| Parameter | Type | Description |
| -- | -- | -- |
| `objects` | __Array__\<__Object__\> | Array containing objects to insert, where the key represent the column-name. All objects must have the same key-structure! |

**Returns**

&rarr; `this`

***

### execute()
`async` &rarr; () &rarr; __any__

Executes the prepared query.

**Returns**

&rarr; __any__ - Query result

***