Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Description of Database Configuration #96

Open
rrcomtech opened this issue Jun 3, 2024 · 0 comments
Open

Incorrect Description of Database Configuration #96

rrcomtech opened this issue Jun 3, 2024 · 0 comments

Comments

@rrcomtech
Copy link

On the website for the DuckDB-Node client, the following is the way to configure the database:

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:

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:

export class Database {
  constructor(path: string, accessMode?: number | Record<string,string>, callback?: Callback<any>);
  constructor(path: string, callback?: Callback<any>);

 ...

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant