Source language: Translate to:

Database plugin offline

Questions, announcements and information regarding PlugIns for NeoAppBuilder

Moderator: Neosoft Support

Database plugin offline

Postby DELCO » Wed Feb 24, 2016 4:34 am

Hello to our excellent plugin developpers !

Can we expect someday, a plugin equivalent to NeobookDBpro, to have a database "offline" ?
It would be great and I think lot of people are ready to pay for it.
Have a good day !
User avatar
DELCO
 
Posts: 132
Joined: Fri Apr 01, 2005 9:12 am

Re: Database plugin offline

Postby stu » Wed Feb 24, 2016 7:09 am

I would like to be able to use SQL Server databases... that would allow me to completetly move away from Neobook into AppBuilder... But I think its looooong wait until that happens, if it happens at all...
User avatar
stu
 
Posts: 320
Joined: Wed Aug 07, 2013 11:37 am

Re: Database plugin offline

Postby anton » Thu Feb 25, 2016 3:09 am

DELCO wrote:Hello to our excellent plugin developpers !

Can we expect someday, a plugin equivalent to NeobookDBpro, to have a database "offline" ?
It would be great and I think lot of people are ready to pay for it.
Have a good day !


I'm afraid that working with offline databases is not the current day is impossible. It is not associated with NeoAppBuilder, it is a problem of security policies on JS. JS is client script, it can't work with DB files.
Required servers and server-side programming languages. The only thing you can hope for is either Web-SQL or Web-Storage. With these databases, you can implement the work locally. But how they will behave for mobile applications, will actually work, I can't tell you.

I think it's not quite the same database with which you would like to work
User avatar
anton
 
Posts: 60
Joined: Fri Oct 19, 2012 9:21 pm

Re: Database plugin offline

Postby luishp » Fri Apr 08, 2016 12:35 am

Regarding offline databases, I would like to ask for your opinion,
Web-SQL technology seems to be deprecated and will no longer be maintained.
But there is a modern alternative named IndexedDB with quite good browser support right now.

Some key features of IndexedDB:
IndexedDB databases store key-value pairs.
IndexedDB is built on a transactional database model.
The IndexedDB API is mostly asynchronous.
IndexedDB uses requests all over the place.
IndexedDB uses DOM events to notify you when results are available.
IndexedDB is object-oriented.
IndexedDB does not use Structured Query Language (SQL).
IndexedDB adheres to a same-origin policy.

I have also found an interesting library / wrapper for IndexedDB named Dexie.js
I am thinking about developing a plugin based on it.
Do you think that it meets your expectations?

Thanks in advance.
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
luishp
 
Posts: 359
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Re: Database plugin offline

Postby DELCO » Fri Apr 08, 2016 4:41 am

Hello Luishp,

First of all, thank you for your work in coding plugins. I am sure all the community appreciate that !

About your next project, I must admit that it is not so clear in my mind... :oops: Do you think it can be more or less "equivalent" to NeobookDBpro ? If yes...I am absolutely okay for it !
Best regards,
User avatar
DELCO
 
Posts: 132
Joined: Fri Apr 01, 2005 9:12 am

Re: Database plugin offline

Postby luishp » Thu May 05, 2016 4:26 am

I have done an extensive research about the possibility to implement offline databases on web apps.
Finally I have found a very interesting library: AlaSQL
It is possible to use almost any SQL command and import and export data from and to EXCEL, CSV or TXT files.

I have implemented a simple test on NAB with nice results, using LocalStorage:
http://sinlios.com/neoappbuilder/plugins/alasql

I have some doubts about persistence of data on client side, as it depends of user not deleting cache.
Your thoughts are very appreciated.

Thanks!
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
luishp
 
Posts: 359
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Re: Database plugin offline

Postby Neosoft Support » Fri May 06, 2016 5:50 pm

Looks interesting. The docs describe the use of "external databases", but unfortunately there isn't much detail. (See: https://github.com/agershun/alasql/wiki/External%20databases) Are INDEXEDDB or FILESTORAGE viable alternatives to LOCALSTORAGE?
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Database plugin offline

Postby luishp » Fri May 06, 2016 11:57 pm

Are INDEXEDDB or FILESTORAGE viable alternatives to LOCALSTORAGE?


They could be used, but they have not worked for me (don't know the reason).
In my shared test I am using this code to initialize the database:

Code: Select all
BeginJS
    alasql.options.angularjs=true;
    alasql('CREATE localstorage DATABASE IF NOT EXISTS testdb');
    alasql('ATTACH localstorage DATABASE testdb');
    alasql('USE testdb');
    alasql("CREATE TABLE IF NOT EXISTS test (Titulo String, Autor STRING, Editorial STRING)");
EndJS


In theory you just need to change "localstorage" with "indexeddb" or "filestorage". But for me it does not work.
Here is a more detailed manual:

http://www.slideshare.net/AndreyGershun ... l-141220-1
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
luishp
 
Posts: 359
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Re: Database plugin offline

Postby TinTin » Wed Jul 13, 2016 2:22 pm

Hi Luis,

Did you have any luck with this? I'm needing to create offline database and view data within a grid in NAB am thinking this maybe the way forward - it would be so helpful if we had a plugin which could help bring local database and grid to NAB..

I did try a few JS grid libraries but It wasn't a success.. :-(

You're plugins so far have been invaluable to my projects so far - total respect for the work you've put in.

Cheers
TinTin
 
Posts: 162
Joined: Sun Dec 06, 2009 4:03 am
Location: UK

Re: Database plugin offline

Postby luishp » Fri Jul 15, 2016 12:20 am

Hi TinTin, thank you for your nice words.
Unfortunatelly I have had not much time to continue exploring this.
In any case all the test I did were not much reliable about data persistence.
I think client side data storage is yet a problem for web technologies although it is evolving quickly.
There is a difficult balance here between functionality and security.

Regards
Luis Hernández - SinLios Soluciones Digitales
http://sinlios.com
User avatar
luishp
 
Posts: 359
Joined: Wed May 23, 2007 10:17 am
Location: Spain

Re: Database plugin offline

Postby TinTin » Sat Jul 16, 2016 1:09 am

more than welcome, yeah I've been reading quite a bit over past few days, it seems that some browsers will be more reliable than others with the data, there was websql but that has been dropped and unsupported for some time now, I did also read that the persistent data can be an issue of reliability when

a) someone clears browser history / cache
b) the system available space is limited - some browsers will clean up to compensate for this

It's possible there's other scenarios though..

Back to drawing board ;-)
TinTin
 
Posts: 162
Joined: Sun Dec 06, 2009 4:03 am
Location: UK


Return to NeoAppBuilder PlugIns

Who is online

Users browsing this forum: No registered users and 0 guests

cron