I assume nothing has changed but maybe it has and I can’t find the solution.
Currently, I send the database as an embedded binary resource at deployment. On boot up, I have to load the resource to memory and then save it to the SD card. Once it is on the SD card I use the standard SQLiteDatabase() function to get it from the SD card. It seems like a lot of extra steps to move the same bytes around. Does anyone have any other way to eliminate the need for the SD card?
Since the language DB is critical to the operation I am hoping to keep it off the SD card in case the SD card gets corrupted. I don’t see any way for TinyCLR to format an SD card or recover it from corruption.
I also use the SqlLite tools on the desktop to create and fill the database. By having it as a resource it gets deployed easily when I do infield updates.
SQLite seems too heavy to me. Another way to load language resource is first serialize language dictionary to json and embed the json as resource. At the boot time microcontroller load the resources and deserialize them in the memory, you can retrive your language from deserialized object all you want.
question is how much / how long you need data to have on DB why not send collected data after certain time on server via FTP ose via WEB API - and kept minimalistic data that you need onto embed system
I do have some FRAM on board already for the fast-changing data that has to be saved every second or more. It is expensive but I could add more, however, SQLite can only load an existing database from a FAT file system. So far TinyCLR only supports FAT on SD or USB.
The primary issue with using FAT in the field is that if it gets corrupted there is no way in TinyCLR to recover it. There is no Format option to re-format an SD or USB drive in the event that it gets corrupted. (At least I don’t find a Format option.)
So while my database lives as a resource in memory, at boot I have to write it to a FAT file system in order to load it into SQLite. If at some point during the life of the device, the FAT files system gets corrupted I can no longer load the database. So while SQLite is a nice feature it shouldn’t be used for anything super critical to the device’s operation.
I haven’t made the change yet but I will probably include the language database as a CSV text file as a resource. At boot up, I will parse through it and load the currently selected language strings into a Hashtable.