JavaScript and local databases..
Moderator: Rathinagiri
- Roberto Lopez
- HMG Founder
- Posts: 3980
- Joined: Wed Jul 30, 2008 6:43 pm
- Has thanked: 27 times
- Been thanked: 168 times
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)
- Rathinagiri
- Posts: 5266
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Has thanked: 171 times
- Been thanked: 173 times
- Contact:
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: 2379
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Has thanked: 629 times
- Been thanked: 127 times
- Contact:
- dhaine_adp
- Posts: 457
- Joined: Wed Aug 06, 2008 12:22 pm
- Location: Manila, Philippines
- Been thanked: 2 times
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
- Roberto Lopez
- HMG Founder
- Posts: 3980
- Joined: Wed Jul 30, 2008 6:43 pm
- Has thanked: 27 times
- Been thanked: 168 times
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
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: 3980
- Joined: Wed Jul 30, 2008 6:43 pm
- Has thanked: 27 times
- Been thanked: 168 times
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)
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