Skip to content

RFC: Add SQLCipher version to the About dialog - #585

Closed
justinclift wants to merge 1 commit into
sqlitebrowser:masterfrom
justinclift:cipher_version
Closed

justinclift wants to merge 1 commit into
sqlitebrowser:masterfrom
justinclift:cipher_version

Conversation

@justinclift

@justinclift justinclift commented May 7, 2016 •

Copy link
Copy Markdown
Member

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.

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.
@justinclift

justinclift commented May 18, 2016 •

Copy link
Copy Markdown
Member Author

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.

@revolter

Copy link
Copy Markdown
Member

By using shell magic, you mean to compile the version inside the app, when building it?

@justinclift

justinclift commented May 26, 2016 •

Copy link
Copy Markdown
Member Author

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.

@revolter

Copy link
Copy Markdown
Member

So, SQLCipher is bundled within the app the building for release only?

@glawrence

Copy link
Copy Markdown
Contributor

@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?

@revolter

revolter commented May 26, 2016 •

Copy link
Copy Markdown
Member

I don't fully understand this. For development I had to brew install sqlcipher, so, isn't it possible for one user to have a version and one user another version?

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.

@justinclift

Copy link
Copy Markdown
Member Author

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? 😄

@justinclift

Copy link
Copy Markdown
Member Author

Closing this for now. Will redo it with a proper (complete) solution at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants