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

feat(sqlite): add fileMustExist option. #9362

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

R-Rajaneesh
Copy link

➕ Added a fileMustExist in the database options

What does this PR do?

This PR adds a check from better-sqlite3 fileMustExist in the options of the constructor.
If fileMustExist is set to true then it'll not create a file on default else the file is created

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

Needed review of this before doing tests.

➕ Added a `fileMustExist` in the database options
@gvilums
Copy link
Contributor

gvilums commented Mar 12, 2024

Thank you for the PR. Do I understand correctly that this new option is the inverse of the create option? In that case I don't think we should implement it, as, in my opinion, the convenience of these redundant options is negated by the confusion they cause.

@R-Rajaneesh
Copy link
Author

Thank you for the PR. Do I understand correctly that this new option is the inverse of the create option? In that case I don't think we should implement it, as, in my opinion, the convenience of these redundant options is negated by the confusion they cause.

@gvilums, Jarred and Dave told me to create an issue for this, since better-sqlite3 has this options and Bun does not, even tho it says it implements all the feature in better-sqlite3. But I created a PR instead, and create was never an option in better-sqlite3 in the first place.

src/js/bun/sqlite.ts Outdated Show resolved Hide resolved
@paperdave paperdave changed the title Update sqlite.ts feat(sqlite): add fileMustExist option. Mar 13, 2024
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

Successfully merging this pull request may close these issues.

None yet

5 participants