JavaScript and local databases..
Moderator: Rathinagiri
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
JavaScript and local databases..
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
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
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: JavaScript and local databases..
fine news!
thanks Roberto for sharing!
Regards, Marek.
thanks Roberto for sharing!
Regards, Marek.
- Rathinagiri
- Posts: 5477
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: JavaScript and local databases..
Wow! That is very promising!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- serge_girard
- Posts: 3222
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: JavaScript and local databases..
Thanks, Roberto !
Serge
Serge
There's nothing you can do that can't be done...
- dhaine_adp
- Posts: 457
- Joined: Wed Aug 06, 2008 12:22 pm
- Location: Manila, Philippines
Re: JavaScript and local databases..
Thanks Roberto this is another milestone that extends the power of HMG with its own Unicode (by Dr. Claudio) and ANSI build.
Regards,
Danny
Manila, Philippines
Danny
Manila, Philippines
Re: JavaScript and local databases..
Note: Local Storage is limited to 5MB.
Fine for phone apps but not so much for fully fledged commercial desktop apps.
HTH
Angel
Fine for phone apps but not so much for fully fledged commercial desktop apps.
HTH
Angel
Angel Pais
Web Apps consultant/architect/developer.
Web Apps consultant/architect/developer.
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: JavaScript and local databases..
You have other alternatives, ie: http://en.wikipedia.org/wiki/Indexed_Database_APIapais wrote:Note: Local Storage is limited to 5MB.
Fine for phone apps but not so much for fully fledged commercial desktop apps.
HTH
Angel
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
-
- Posts: 16
- Joined: Sat Apr 19, 2014 10:17 am
Re: JavaScript and local databases..
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.
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.
- Roberto Lopez
- HMG Founder
- Posts: 4012
- Joined: Wed Jul 30, 2008 6:43 pm
Re: JavaScript and local databases..
Thanks!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.
It looks good.
I'll test it ASAP.
Regards/Saludos,
Roberto
(Veritas Filia Temporis)
Roberto
(Veritas Filia Temporis)
Re: JavaScript and local databases.. XPCOM Mozilla
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
You can using GreaseMonkey or iMacros4Firefox run javascript code inside XPCOM architecture inside Mozilla Firefox.
https://www.google.es/search?q=xpcom+sq ... easemonkey