While WebSQL is deprecated IndexedDB is not supported by all browsers (especially iOS) so WebSQL is still needed. Saltarelle provides classes to use WebSQL in C#, however, it does not implement the "window.openDatabase" method used to open a database and to obtain a reference to an SqlDatabase object.
There are two classes this method can belong to - the "Window" class and the "SqlDatabase" class. Putting it in the "Window" class will correspond to the way the method is invoked in JavaScript. However, putting it in the SqlDatabase class may make its usage more intuitive.
[ScriptAlias("window.openDatabase")]
public static SqlDatabase Open(string name, string version, string displayName, int estimatedSize)
{
return null;
}
I may also be nice to add a property or method that checks if WebSQL is supported by the browser:
public static bool IsSupported
{
[InlineCode("typeof(window.openDatabase) == typeof(Function)")]
get
{
return false;
}
}
I can create a pull request if there is a consensus on the matter.
While WebSQL is deprecated IndexedDB is not supported by all browsers (especially iOS) so WebSQL is still needed. Saltarelle provides classes to use WebSQL in C#, however, it does not implement the "window.openDatabase" method used to open a database and to obtain a reference to an SqlDatabase object.
There are two classes this method can belong to - the "Window" class and the "SqlDatabase" class. Putting it in the "Window" class will correspond to the way the method is invoked in JavaScript. However, putting it in the SqlDatabase class may make its usage more intuitive.
I may also be nice to add a property or method that checks if WebSQL is supported by the browser:
I can create a pull request if there is a consensus on the matter.