duckdb / duckdb/duckdb-node

Incorrect Description of Database Configuration

Open
#96 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
91
Forks
36
PR merge metrics
No merged PRs in 30d

Description

On the [website for the DuckDB-Node client](https://duckdb.org/docs/archive/0.10/api/nodejs/overview), the following is the way to configure the database:

```javascript
const db = new duckdb.Database(':memory:', {
"access_mode": "READ_WRITE",
"max_memory": "512MB",
"threads": "4"
}, (err) => {
if (err) {
console.error(err);
}
});
```

However, running this results in:

```javascript
src/store.controller.ts:25:55 - error TS2322: Type 'number' is not assignable to type 'string'

25 { access_mode: "READ_WRITE", max_memory: "8GB", threads: 4 },
~~~~~~~
```

Which is totally not surprising looking at what goes on in the `Database` constructor:

```javascript
export class Database {
constructor(path: string, accessMode?: number | Record, callback?: Callback);
constructor(path: string, callback?: Callback);

...
```

It does not hold any possibility to hand over the described configuration parameters.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.