0

Clarification before I begin:

I have an SQLite database that will not be written to at all by the program accessing it. It exists only to store information in an easy to access format for coding purposes.

Any corrections to the data in the database will be done with another application, and then the updated file will be recompiled into the final standalone executable file.


If it is possible, how does one go about embedding an SQLite file into an executable and then accessing its contents as if it were a standalone file like normal? I know you need a connection string but how would you format it in this case?

This is for a C# WPF application on .NET framework 4.5.2.

Anders
  • 12,088
  • 34
  • 98
  • 146
  • I'm not able to find it in C# sqlite docs, but C api has `deserialize()` routine handy for this. https://stackoverflow.com/a/73547025/19270727 – gizlu Aug 30 '22 at 18:44

1 Answers1

1

By default, SQLite can load data only from database files.

You could write your own VFS that maps file accesses to memory accesses. However, this would require writing the VFS in C, and recompiling the System.Data.SQLite driver.

CL.
  • 173,858
  • 17
  • 217
  • 259