Page 1 of 1

JavaScript and local databases..

Posted: Fri Dec 26, 2014 1:35 pm
by Roberto Lopez
Hi All,

HMGSCRIPT could be used to create fully local applications.

In such case you don't need any web server, you must open the main app html file and it will work.

But... what about a local databases?

You surely know that JavaScript is 'sandboxed', meaning that it can't access local file system, so... how to do it?

HTML5 introduced local storage facilities.

slq.js (Sqlite compiled to JavaScript) uses HTML5 local storage to allow you to work with SQL local databases.

So... a full JavaScript app with local databases...? YES!

https://github.com/kripken/sql.js

Re: JavaScript and local databases..

Posted: Fri Dec 26, 2014 1:56 pm
by mol
fine news!
thanks Roberto for sharing!
Regards, Marek.

Re: JavaScript and local databases..

Posted: Fri Dec 26, 2014 2:16 pm
by Rathinagiri
Wow! That is very promising!

Re: JavaScript and local databases..

Posted: Fri Dec 26, 2014 2:21 pm
by serge_girard
Thanks, Roberto !

Serge

Re: JavaScript and local databases..

Posted: Fri Dec 26, 2014 3:20 pm
by dhaine_adp
Thanks Roberto this is another milestone that extends the power of HMG with its own Unicode (by Dr. Claudio) and ANSI build.

Re: JavaScript and local databases..

Posted: Fri Dec 26, 2014 3:27 pm
by apais
Note: Local Storage is limited to 5MB.
Fine for phone apps but not so much for fully fledged commercial desktop apps.

HTH
Angel

Re: JavaScript and local databases..

Posted: Fri Dec 26, 2014 9:38 pm
by Roberto Lopez
apais wrote:Note: Local Storage is limited to 5MB.
Fine for phone apps but not so much for fully fledged commercial desktop apps.

HTH
Angel
You have other alternatives, ie: http://en.wikipedia.org/wiki/Indexed_Database_API

Re: JavaScript and local databases..

Posted: Sat Dec 27, 2014 11:45 pm
by mruizcanete
Another tool to handle sql but without the limitations of web sql storage or local storage. And it's fully documented in Spanish also.
javascriptsql.sourceforge.net/ARCH/index.html
I've tried the test and it's quite nice. Tried locally but I had to deal with the Chrome problem about file:// as starting address that I solved in windows after some googling.
Perhaps using different tools but in the same project it would be possible to build an application as it is expected: one-single page html with hmgscript, javascript.js, jquery mobile... with no servers at all, and in every compatible browser with html5.
Dreams becoming true?
Thanks to all for this big effort in these days. Merry Christmas to everybody and a happy new year from this humble Spaniard.

Re: JavaScript and local databases..

Posted: Sun Dec 28, 2014 4:06 pm
by Roberto Lopez
mruizcanete wrote:Another tool to handle sql but without the limitations of web sql storage or local storage. And it's fully documented in Spanish also.
javascriptsql.sourceforge.net/ARCH/index.html
I've tried the test and it's quite nice. Tried locally but I had to deal with the Chrome problem about file:// as starting address that I solved in windows after some googling.
Perhaps using different tools but in the same project it would be possible to build an application as it is expected: one-single page html with hmgscript, javascript.js, jquery mobile... with no servers at all, and in every compatible browser with html5.
Dreams becoming true?
Thanks to all for this big effort in these days. Merry Christmas to everybody and a happy new year from this humble Spaniard.
Thanks!

It looks good.

I'll test it ASAP.

Re: JavaScript and local databases.. XPCOM Mozilla

Posted: Fri Dec 04, 2015 8:58 pm
by juanato
XPCOM Mozilla can assist Firefox to via storage class call from Javascript sqlite commands.

You can using GreaseMonkey or iMacros4Firefox run javascript code inside XPCOM architecture inside Mozilla Firefox.


https://www.google.es/search?q=xpcom+sq ... easemonkey