No announcement yet.

SQLite best practices ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • SQLite best practices ?

    I'm getting started with SQLite for my plugins. Looking over other threads I believe I know how to setup the DLL files and exe.config etc. I do have a couple questions of the best practices variety.
    • Is there a standard for where I should store my DB file? I've seen some place in the top level HS3 directory. I'm assuming that HS3\Data\MYPLUGIN would make the most sense?
    • Is there a standard extension name for the SQLite DB file that should be used? .db .db3 .hsd .sqlite
    • SQLite DB connections: open once at plugin start and close at shutdown? Or are you open/closing connections during the life of the plugin run as there's data to add or read/use?
    • Has anyone run into any DB file corruption issues and have tips/tricks for avoiding that?
    • Any Linux tips? I recently started testing one of my plugins under Linux HS3 and so far so good. When using SQLite, any tips on maintaining platform compatibility for both windows/linux ?

    HS (PRO)
    Hardware: Napco GEM-P9600 | VenstarT1800 w/Insteon 2441V adapter | Insteon PLM
    Plugins HS3: Napco Gemini (mine) | Insteon Thermostat (mine) | Insteon Plug-in (mnsandler) | HSTouch Server (HST)
    Platform: Windows 10 Pro 64bit, core2 duo 2.0Ghz, 4GB memory