Datagrip locks sqlite3 database permanently
Hi, my plan was to run a python (batch-style) program (in pycharm, of course) and simultaneously keep tabs on progress by running queries in Datagrip. However, datagrip seems to keep a permanent lock on the database, blocking my python program from storing results in the sqlite database.
Is this intentional? Is there a setting to fix this? Can I open the database in "read only" mode in Datagrip?
请先登录再写评论。
Using Xerial connector, you have access to sqlite pragmas on the advanced tab. Could you set open_mode to SQLITE_OPEN_READONLY? Maybe set shared_cache to true, also.
I don't know if that will work, but maybe.
This appears to not block the database, but there's a downside - I can't run queries anymore:
> java.lang.NumberFormatException: For input string: "SQLITE_OPEN_READONLY"
Change the open_mode value from SQLITE_OPEN_READONLY to a numeric one: 1.
SQLite C Interface
Flags For File Open Operations
Try just a Read-only checkbox in the Data source properties.
Sorry for being a little daff on my end. Where is the Read-Only checkbox located? I've been through the DS properties and cannot find one.
Look at the screenshot: https://d3nmt5vlzunoa1.cloudfront.net/datagrip/files/2017/07/MySQLSwitcher-1.png
@maxim The screenshot you posted seem to be from MySQL? The question was about sqlite, which doesn't have that read-only checkbox.
Ah, sorry. We discovered some time ago that for some databases this driver option actually lets you run updates and inserts. Now we're working on resolving it from our side, I mean the application will restrict you. But in the current version, there is no such possibility.