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

Add support for create: true to Bun SQLite database imports #8202

Open
TomasHubelbauer opened this issue Jan 16, 2024 · 2 comments
Open

Add support for create: true to Bun SQLite database imports #8202

TomasHubelbauer opened this issue Jan 16, 2024 · 2 comments
Labels
bun:sqlite Something to do with bun:sqlite enhancement New feature or request

Comments

@TomasHubelbauer
Copy link

What is the problem this feature would solve?

Would be able to use the SQLite database import while also wanting the create: true behavior the current Database constructor exposes.

What is the feature you are proposing to solve the problem?

import database from './db.sqlite' with { type: 'sqlite', create: true };
console.log(database.prepare(`SELECT sqlite_version()`).get());

What alternatives have you considered?

Not doing it, people can always use the Database constructor.

@TomasHubelbauer TomasHubelbauer added the enhancement New feature or request label Jan 16, 2024
@Electroid Electroid added the bun.js Something to do with a Bun-specific API label Jan 16, 2024
@Electroid
Copy link
Contributor

This makes sense, though we would have to make it “true” as a string, due to how import attributes works.

@infrahead
Copy link

infrahead commented Jan 19, 2024

Yes please. Ideally should support any open flags supported by the Database constructor. E.g I'd also like readOnly.

and not sure if needs to be another issue, but expanding to these other options would be even better: #8178 (comment)

@Electroid Electroid added bun:sqlite Something to do with bun:sqlite and removed bun.js Something to do with a Bun-specific API labels Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bun:sqlite Something to do with bun:sqlite enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants