-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
refactor: use pragma method in better-sqlite3 #10684
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
Conversation
This is the recommended way to run pragmas.
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @mohd-akram for your help.
Are any drawbacks about this change?
|
@gioboa No drawbacks that I'm aware of. |
Thanks 👍 |
If you want to use bun's sqlite driver (similar to Bun-related issue: #11236 |
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this is not working with bun 🤔
An idea is to check the runtime and create a condition in the code eg. detect Bun.
What do you think?
|
We don't support bun at the moment, so my comment was there just in case we would like to 🤷🏻 I played a bit with Later edit: bun has a ticket to add support for |
|
what is the status of this PR? have the admins agreed or disagreed to review/merge this work? |
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me
Thanks @mohd-akram
PR Code Suggestions ✨No code suggestions found for the PR. |
commit: |
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are fine.
What's the benefit of using pragma ? is it faster? reliable?
|
hmm,
https://github.com/WiseLibs/better-sqlite3/blob/master/docs/api.md#pragmastring-options---results |
gioboa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help @mohd-akram
Description of change
Use the
pragmamethod in better-sqlite3. This is the recommended way to run pragmas.Pull-Request Checklist
masterbranchnpm run formatto apply prettier formattingnpm run testpasses with this change