locked
[HTML]SqlLite with HTML5/JS Windows App RRS feed

  • Question

  • I am developing a forms app for windows store platform using HTML5/JS. APP needs to store data locally (images, json, generated Pdfs etc) . App would mostly work in offline mode, but on obtaining internet connectivity data will be synced with the web server app.

    My question is, Is SQLLite an option for me considering this is a HTML5 application on Windows store. I tried searching on MSDN to see the recommended way of using SQLLite in a HTML5/JS windows store app but couldn't find anything.

    Second alternative is IndexedDB. Is that a good choice considering the amount of data that is required to be stored here locally




    Thursday, October 29, 2015 1:18 AM

Answers

  • Hello spnewbie2012,

    >>Is SQLLite an option for me considering this is a HTML5 application on Windows store.

    Yes. Although the SQLite extension makes it easy to add a reference and build against SQLite, the SQLite APIs are written in C. To use them from your app, you must wrap the SQLite APIs in a WinRT component that you expose to JavaScript.

    This article explains the whole scenario. Writing a SQLite wrapper component for universal Windows apps

    There is also a working example sample for this. Universal JavaScript SQLite Sample

    You can also find the extension for UWP here.  SQLite for Universal App Platform

    >>Second alternative is IndexedDB. Is that a good choice considering the amount of data that is required to be stored here locally

    For security reasons, support for the indexedDB property is limited to Windows Store apps and to webpages loaded using the "http://" or "https://" protocols. The maximum browser storage space is dynamic it is based on your hard drive size. The global limit is calculated as 50% of free disk space.

    With Regards,

    Krunal Parekh


    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Krunal Parekh Thursday, October 29, 2015 5:38 AM
    • Proposed as answer by Krunal Parekh Thursday, October 29, 2015 5:45 AM
    • Marked as answer by Krunal Parekh Monday, November 9, 2015 10:00 AM
    Thursday, October 29, 2015 5:37 AM

All replies

  • Hello spnewbie2012,

    >>Is SQLLite an option for me considering this is a HTML5 application on Windows store.

    Yes. Although the SQLite extension makes it easy to add a reference and build against SQLite, the SQLite APIs are written in C. To use them from your app, you must wrap the SQLite APIs in a WinRT component that you expose to JavaScript.

    This article explains the whole scenario. Writing a SQLite wrapper component for universal Windows apps

    There is also a working example sample for this. Universal JavaScript SQLite Sample

    You can also find the extension for UWP here.  SQLite for Universal App Platform

    >>Second alternative is IndexedDB. Is that a good choice considering the amount of data that is required to be stored here locally

    For security reasons, support for the indexedDB property is limited to Windows Store apps and to webpages loaded using the "http://" or "https://" protocols. The maximum browser storage space is dynamic it is based on your hard drive size. The global limit is calculated as 50% of free disk space.

    With Regards,

    Krunal Parekh


    Thanks MSDN Community Support Please remember to Mark as Answer the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Krunal Parekh Thursday, October 29, 2015 5:38 AM
    • Proposed as answer by Krunal Parekh Thursday, October 29, 2015 5:45 AM
    • Marked as answer by Krunal Parekh Monday, November 9, 2015 10:00 AM
    Thursday, October 29, 2015 5:37 AM
  • Thanks for the insights Krunal. This helps!
    Wednesday, November 11, 2015 3:12 PM