System.Data.SQLite

Login
This project makes use of Eagle, provided by Mistachkin Systems.
Eagle: Secure Software Automation
Ticket Hash: eae1679ea3250fcf258f4efa4ffb0afe75de478c
Title: Can I pass the 'immutable' query as part of my connection string
Status: Closed Type: Question
Severity: Important Priority: Medium
Subsystem: Connection Resolution: Works_As_Designed
Last Modified: 2020-05-23 23:49:47
Version Found In: 3
User Comments:
anonymous added on 2020-04-27 17:11:07:

I am trying to connect to a database file that I am uploading to an Azure function. This means that I only have read-only access to the database and the directory.

My current code for connecting (.NetCore using System.Data.Sqlite.Core) looks like this:

using(var con = new SQLiteConnection($"Data Source={fullUri}; Immutable=1; ReadOnly=True; Journal Mode=Off"))

Checking locally my commands work. When uploaded to the Azure function I can read a text file in the same folder as the database file (thus I have path to database and read-rights on the folder). I can connect to the database but not execute any queries, I get the error 'database-locked'. I only want to read from the database, and so would be happy to use the 'immutable' keyword, but it seems that the connection-string format does not support this?

Am I correct in my understanding? Is there a workaround so that I can read data from a read-only directory? Many thanks, Hugh


mistachkin added on 2020-05-23 23:49:47:
There is no "Immutable" connection string property.  There is a "Read Only"
connection string property that may accomplish what you want; however, this
has not been tested using cloud storage solutions like Azure.