Page 1 of 1

Database plugin offline

PostPosted: Wed Feb 24, 2016 4:34 am
by DELCO
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 !

Re: Database plugin offline

PostPosted: Wed Feb 24, 2016 7:09 am
by stu
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...

Re: Database plugin offline

PostPosted: Thu Feb 25, 2016 3:09 am
by anton
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

Re: Database plugin offline

PostPosted: Fri Apr 08, 2016 12:35 am
by luishp
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.

Re: Database plugin offline

PostPosted: Fri Apr 08, 2016 4:41 am
by DELCO
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,

Re: Database plugin offline

PostPosted: Thu May 05, 2016 4:26 am
by luishp
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!

Re: Database plugin offline

PostPosted: Fri May 06, 2016 5:50 pm
by Neosoft Support
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?

Re: Database plugin offline

PostPosted: Fri May 06, 2016 11:57 pm
by luishp
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

Re: Database plugin offline

PostPosted: Wed Jul 13, 2016 2:22 pm
by TinTin
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

Re: Database plugin offline

PostPosted: Fri Jul 15, 2016 12:20 am
by luishp
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

Re: Database plugin offline

PostPosted: Sat Jul 16, 2016 1:09 am
by TinTin
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 ;-)