I am trying to find an API within WinRT that will allow me to create a local database that can be used to store data for an occasionally connected application. I am looking for something like SQL Compact Edition.
I have seen various messages on various boards indicating that there either
- (a) will be no local databases whatsoever
- (b) no local "server" databases (i.e. SQL Express type instances)
- (c) A local database code named "Jet Blue".
Does anybody have a definitive answer to this? I do not want to start down this road if it is blocked.
There are 3rd party solutions coming out or are already out. CodePlex has one -- http://sqlwinrt.codeplex.com/
The other option, which requires some work on your part, is to proxy your database access through a web service.
There is no SQL CE available for Metro.
a) will be no local databases whatsoever
This is not true. SQLite should be able to run on WinRT. You can download the code here and include the two main files into your WinRT project. To compile and pass certification you will need to make sure you are using the correct WinRT replacement calls for the Win32 calls that are not supported. The 3rd party solution Bob mentioned is a WinRT wrapper it doesn't include changes to SQLite to pass certification.
(b) no local "server" databases (i.e. SQL Express type instances)
It seems unlikely there will be SQL Express for metro.
(c) A local database code named "Jet Blue".
If you mean Microsoft Jet Database engine, yes that seems to be supported but I would rather use SQLite.
Also remember if you are using HTML/JS you have the option of using IndexedDB
There is no (built in) database according to this
http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-930C
Do you really need a "store data for an occasionally connected application"? This sounds a little overkill to me. Why not serialize the data (various options) to storage yourself?
SQLite is now officially supported. See Tim Heuer's blog for details. For simpler solution with less data you can use http://winrtdatabase.codeplex.com/
You might want to have a look at SQLite3-WinRT, a wrapper for SQLite that we wrote to use it in a Metro-style application. It contains a version of SQLite that uses only WinRT-compatible API, and a WinRT component to use it in C# and JavaScript apps.