JavaScript and local databases..

Moderator: Rathinagiri

Post Reply
User avatar
Roberto Lopez
HMG Founder
Posts: 3876
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 12 times
Been thanked: 105 times

JavaScript and local databases..

Post by Roberto Lopez » Fri Dec 26, 2014 1:35 pm

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
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
mol
Posts: 2705
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Has thanked: 79 times
Been thanked: 25 times
Contact:

Post by mol » Fri Dec 26, 2014 1:56 pm

fine news!
thanks Roberto for sharing!
Regards, Marek.

User avatar
Rathinagiri
Posts: 5077
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 89 times
Been thanked: 103 times
Contact:

Post by Rathinagiri » Fri Dec 26, 2014 2:16 pm

Wow! That is very promising!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
serge_girard
Posts: 1684
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 201 times
Been thanked: 30 times
Contact:

Post by serge_girard » Fri Dec 26, 2014 2:21 pm

Thanks, Roberto !

Serge

User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines

Post by dhaine_adp » Fri Dec 26, 2014 3:20 pm

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

User avatar
apais
Posts: 223
Joined: Fri Aug 01, 2008 6:03 pm
Location: uruguay
Has thanked: 16 times
Been thanked: 7 times
Contact:

Post by apais » Fri Dec 26, 2014 3:27 pm

Note: Local Storage is limited to 5MB.
Fine for phone apps but not so much for fully fledged commercial desktop apps.

HTH
Angel

User avatar
Roberto Lopez
HMG Founder
Posts: 3876
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 12 times
Been thanked: 105 times

Post by Roberto Lopez » Fri Dec 26, 2014 9:38 pm

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
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

mruizcanete
Posts: 16
Joined: Sat Apr 19, 2014 10:17 am

Post by mruizcanete » Sat Dec 27, 2014 11:45 pm

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.

User avatar
Roberto Lopez
HMG Founder
Posts: 3876
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 12 times
Been thanked: 105 times

Post by Roberto Lopez » Sun Dec 28, 2014 4:06 pm

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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

juanato
Posts: 6
Joined: Fri Sep 21, 2012 2:42 pm

Post by juanato » Fri Dec 04, 2015 8:58 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests