Skip to content

fix: Migrate from better-sqlite3 to node-sqlite3-wasm #2246

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

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

Conversation

dividedmind
Copy link
Collaborator

This pull request replaces the better-sqlite3 library with node-sqlite3-wasm.

Benefits:

  • no need to recompile across Node versions and platforms,
  • allows creating a single js bundle distribution in the future,
  • avoids dynamic linking of the unsigned sqlite DLL which might trip up antivirus software.

Dependency updates:

Code modifications:

  • Updated import statements to use node-sqlite3-wasm instead of better-sqlite3 in multiple files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]
  • Changed the instantiation of the SQLite database from new sqlite3(indexFile) to new sqlite3.Database(indexFile) in several functions. [1] [2] [3] [4] [5] [6]
  • Adjusted method calls and parameters to match the new library's API, including changes to prepare and run methods in FileIndex and SnippetIndex classes. [1] [2] [3] [4] [5] [6]

These changes ensure compatibility with the new SQLite library and maintain the functionality of the existing codebase.

@dividedmind dividedmind self-assigned this Feb 17, 2025
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.

1 participant