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 SQLcipher to SQLite implementation #11397

Open
MarByteBeep opened this issue May 27, 2024 · 1 comment
Open

Add SQLcipher to SQLite implementation #11397

MarByteBeep opened this issue May 27, 2024 · 1 comment
Labels
bun:sqlite Something to do with bun:sqlite enhancement New feature or request

Comments

@MarByteBeep
Copy link

What is the problem this feature would solve?

Currently the sqlite implementation, which is based on better-sqlite3, doesn't seem to support (sqlcipher) encrypted databases.

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

Would it be possible to add sqlcipher (https://www.zetetic.net/sqlcipher/) support, such that the following would be allowed?

db.run('PRAGMA cipher_compatibility = 4');
db.run(`PRAGMA key = 'mysecretkey'`);
db.run('PRAGMA journal_mode = WAL');

Currently I get an error when attempting to read from an encrypted sqlite database:

SQLiteError: file is not a database
 errno: 26
  code: "SQLITE_NOTADB"

What alternatives have you considered?

I've tried node-sqlcipher which seems to work fine, but since it's based on @mapbox code, I run into a whole bunch of webpack errors when tying to use the database in combination with vite, as is discussed here: mapbox/node-pre-gyp#661

It would be so awesome if Bun simply supports this out-of-the-box

@MarByteBeep MarByteBeep added the enhancement New feature or request label May 27, 2024
@Electroid Electroid added the bun:sqlite Something to do with bun:sqlite label May 27, 2024
@dalisoft
Copy link

+1

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