0

I'm trying to connect to my database through Rider but it doesn't work since I encrypted my database with SQLCipher. Tutorials say I should add these fields in the "Advanced" tab but that doesn't work:

enter image description here

I can connect using Microsoft.Data.Sqlite so it's not a file corruption problem, I just don't understand how to use the IDE (JetBrains Rider 2025.3.0.1) properly.

I get this error:

Error encountered when performing Introspect schema main: [SQLITE_NOTADB] File opened that is not a database file (file is not a database).
[SQLITE_NOTADB] File opened that is not a database file (file is not a database).

which is similar to the error I have if I try to open the database through code without a password. But I did specify the (correct) password in the Advanced tab of the Data Sources and Drivers Rider SQL IDE.

6
  • We have a feature request to make this configuration more UI friendly: youtrack.jetbrains.com/issue/DBE-5380/… Please see also this workaround, including the driver and class setup, and see if it works Commented Nov 20 at 13:12
  • Hi @AlexanderMolchanov I don't really see how I can do that, that seems very Java specific and also very code specific, I don't see how I could integrate this to Rider's UI built-in database IDE. Commented Nov 22 at 16:40
  • As per instructions Use JDBC driver from github.com/Willena/sqlite-jdbc-crypt and provide cipher and key(pwd) via JDBC URL, e.g.: jdbc:sqlite:/path/to/my/encrypted.db?cipher=sqlcipher&key=thepassword just substitute the password and db path in url and use this url in options, there are always options in the db ui where a person can enter Commented Nov 22 at 20:36
  • Hi @wui I'm a bit confused, how do I give the JDBC driver to Rider? I downloaded the .jar (sqlite-jdbc-3.49.1.0.jar) but I don't know what to do with a .jar. Sorry I'm a beginner. Commented Nov 22 at 20:39
  • Your config looks right to me. Quick question - are you adding those PRAGMA settings in the "Advanced" tab under your data source settings, or somewhere else? Also, what happens when you try to connect - does it give you a specific error message, or does it just fail silently? That might help narrow down whether it's a key issue vs. a cipher compatibility thing. Commented Nov 24 at 4:59

1 Answer 1

1
+50

I repeated the steps with Intelij (same as any other JetBrains' products, such as Rider). It works perfectly. For the context, the built-in SQLite driver in JetBrains IDEs does not support SQLCipher encryption. The reason you see that error is simply because that default sqlite driver just see your encrypted database as a bunch of random bytes with no meaning.

First, download the sqlite-jdbc-crypt (I downloaded sqlite-jdbc-3.50.1.0.jar)

Second, define a custom driver:

enter image description here

Third, add your driver file that you downloaded from the first step

enter image description here

It must look like this:

enter image description here

Then, use that recently added driver as your "Data Source".

Finally, add a url like this containing the address to your encrypted sqlite db file, your key, kdf_iter, etc: jdbc:sqlite:file:/home/USER/test_database_v4.db?cipher=sqlcipher&legacy=4&kdf_iter=256000&cipher_page_size=4096&key=mySecretPassword123

If the error persists:

  • Verify your password is correct
  • Try different legacy values: 2, 3, or 4 (SQLCipher version, mine is 4)
  • If you created the database with custom settings, match those exact parameters

That's it!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.