Repository navigation
RFC: Add SQLCipher version to the About dialog - #585
justinclift wants to merge 1 commit into
Conversation
This isn't fully worked out yet, as it appears to need an open database connection for the string retrieval to work. Without an open database the field is left blank. Not sure if it's something caused by us, or a requirement from the underlying SQLCipher library itself. Either way, we'll need to find a solution to that for this to be useful.
|
Thinking about this more, even if the SQLCipher library itself doesn't provide a compile time definition with the version number , we can probably create one ourselves. Might take some shell magic (and would need to be cross-platform'd), but should be doable. |
|
By using shell magic, you mean to compile the version inside the app, when building it? |
|
Yeah, if one isn't provided. They have a runtime function that can be called, but seems to only be available when a database is loaded. That doesn't fit well with use of such a function in a GUI. |
|
So, SQLCipher is bundled within the app the building for release only? |
|
@revolter I believe SQLCipher is a replacement for the standard SQLite library, rather than it being an addin or plugin or extension to SQLite it is a "drop in" replacement. However they don't have a suitable runtime function for the version without opening a database. I guess @justinclift we have some options, we could open a test database at build time get the version number and add that to a header for our use. Or we could just use their runtime and say "open a database" on the about screen. Or in theory could we issue a pull request or feature request asking for this? |
|
I don't fully understand this. For development I had to Also, the runtime empty database was what I wanted to say next, though it looks a little bit hacky 😄. And it was asked here already. |
|
Yeah, in this context SQLCipher is a drop-in replacement for SQLite3, done at compile time. So, when compiling DB4S, either SQLCipher or SQLite3 gets compiled in. We could do the "make a dummy database, retrieve the info, close the database" at startup time. But yeah, that's way too hacky. It'll probably be more reliable to somehow automatically extract the version number of SQLCipher at compile time, generate a constant or define for that at compile time, then embed it into the About dialog. It's unlikely to be super tricky for the *nix OS's, but I'm unsure how to approach that on Windows. Can probably muddle through it though, unless someone else wants to investigate? 😄 |
|
Closing this for now. Will redo it with a proper (complete) solution at some point. |
Note - this is just for discussion at this point, don't merge it yet.
This commit adds the SQLCipher version number to the About dialog.
Weirdly, retrieving the SQLCipher version number appears to need an open database connection. So, without an open database the field is left blank.
Updating this commit to cleanly handle both situations is required before merging this.
Btw - unsure if the requirement for an open database connection is something caused by our code, or a requirement from the underlying SQLCipher library itself. The SQLCipher version seems like it should be available at compile time, not just at runtime.