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

new Database with { create: false } throws SQLITE_MISUSE #15876

Open
7flash opened this issue Dec 19, 2024 · 0 comments
Open

new Database with { create: false } throws SQLITE_MISUSE #15876

7flash opened this issue Dec 19, 2024 · 0 comments
Labels
bug Something isn't working bun:sqlite Something to do with bun:sqlite

Comments

@7flash
Copy link

7flash commented Dec 19, 2024

What version of Bun is running?

1.1.38+bf2f153f5

What platform is your computer?

Linux 5.15.167.4-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

import { Database } from 'bun:sqlite';

new Database('first.sqlite', { create: true });
console.log('database was created');

try {
    new Database('first.sqlite', { create: false });
} catch (err) {
    console.error('but fails to open', err)
}

runs with following output

database was created
but fails to open 2 | 
3 | new Database('first.sqlite', { create: true });
4 | console.log('database was created');
5 | 
6 | try {
7 |     new Database('first.sqlite', { create: false });
        ^
SQLiteError: bad parameter or other API misuse
 errno: 21
  code: "SQLITE_MISUSE"

      at new Database (bun:sqlite:236:28)
      at /home/galaxy/askuai/test.ts:7:5

@7flash 7flash added bug Something isn't working needs triage labels Dec 19, 2024
@DonIsaac DonIsaac added bun:sqlite Something to do with bun:sqlite and removed needs triage labels Dec 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun:sqlite Something to do with bun:sqlite
Projects
None yet
Development

No branches or pull requests

2 participants