utelle / SQLite3MultipleCiphers

SQLite3 encryption extension with support for multiple ciphers
https://utelle.github.io/SQLite3MultipleCiphers/
MIT License
390 stars 73 forks source link

Feature Request: Multiplex #121

Closed titanism closed 11 months ago

titanism commented 11 months ago

Is it possible for multiplex extension to be added? <https://www.sqlite.org/src/doc/trunk/src/test_multiplex.c>

Or how might one use this with https://github.com/m4heshd/better-sqlite3-multiple-ciphers? Assuming a custom build would be required with added extensions.

utelle commented 11 months ago

Is it possible for multiplex extension to be added? https://www.sqlite.org/src/doc/trunk/src/test_multiplex.c

Normal SQLite extensions are usually loadable extensions adding functionality that can be used from SQL via so-called user-defined functions. This is not the case for the multiplex extension. This extension is not a loadable extension but a SQLite VFS shim. It adds a special entry point for initializing the extension and requires that certain file-control operations can be executed.

That is, you can't simply add this extension without further modifications. Therefore I don't plan to add this extension.

Using this extension in combination with SQLite3 Multiple Ciphers is not trivial. SQLite3 Multiple Ciphers is also a VFS shim. Although it is possible to use nested VFS shims, you need to know what you are doing. For example, the multiplex shim would have to sit between the SQLite3 Multiple Ciphers shim and the real VFS to be operational. Otherwise you will most likely get corrupted database files.

Or how might one use this with https://github.com/m4heshd/better-sqlite3-multiple-ciphers? Assuming a custom build would be required with added extensions.

I don't know any details about better-sqlite3-multiple-ciphers and personally I never used it so far, but you would definitely need to do a custom build and to adjust/extend the better-sqlite3-multiple-ciphers API.