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

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

## DuckDB.(constructor)

Represents a native instance of DuckDB.

<b>Signature:</b>

```typescript
constructor(config?: IDuckDBConfig);
```

## Parameters

| Parameter | Type                                            | Description                                                                                    |
| --------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| config    | [IDuckDBConfig](./node-duckdb.iduckdbconfig.md) | optional configuration object of type [IDuckDBConfig](./node-duckdb.iduckdbconfig.md)<!-- -->. |

## Example 1

Initializing a duckdb database in memory:

```ts
import { DuckDB } from "node-duckdb";
const db = new DuckDB();
```

## Example 2

Initializing a duckdb database from file:

```ts
import { DuckDB } from "node-duckdb";
const db = new DuckDB({ path: join(__dirname, "./mydb") });
```

## Example 3

Initializing a duckdb database from file and setting some additional options:

```ts
import { DuckDB, OrderType } from "node-duckdb";
const db = new DuckDB({
  path: join(__dirname, "./mydb"),
  options: { defaultOrderType: OrderType.Descending, temporaryDirectory: false },
});
```
