<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Node-DuckDB API](./node-duckdb.md) &gt; [Connection](./node-duckdb.connection.md)

## Connection class

Represents a DuckDB connection.

<b>Signature:</b>

```typescript
export declare class Connection
```

## Remarks

A single db instance can have multiple connections. Having more than one connection instance is required when executing concurrent queries.

## Constructors

| Constructor                                                        | Modifiers | Description             |
| ------------------------------------------------------------------ | --------- | ----------------------- |
| [(constructor)(duckdb)](./node-duckdb.connection._constructor_.md) |           | Connection constructor. |

## Properties

| Property                                         | Modifiers | Type    | Description                                                |
| ------------------------------------------------ | --------- | ------- | ---------------------------------------------------------- |
| [isClosed](./node-duckdb.connection.isclosed.md) |           | boolean | If the connection is closed returns true, otherwise false. |

## Methods

| Method                                                                           | Modifiers | Description                                                                                                                                                                                                      |
| -------------------------------------------------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [close()](./node-duckdb.connection.close.md)                                     |           | Close the connection (also closes all [Readable](https://nodejs.org/api/stream.html#stream_class_stream_readable) or [ResultIterator](./node-duckdb.resultiterator.md) objects associated with this connection). |
| [execute(command, options)](./node-duckdb.connection.execute.md)                 |           | Asynchronously executes the query and returns a [Readable stream](https://nodejs.org/api/stream.html#stream_class_stream_readable) that wraps the result set.                                                    |
| [executeIterator(command, options)](./node-duckdb.connection.executeiterator.md) |           | Asynchronously executes the query and returns an iterator that points to the first result in the result set.                                                                                                     |
