I would like to use electronjs to develop a desktop application. The app has to have an offline and online database, such that when the system connects to the Internet, the databases can sync.. How can I achieve this please. Using nodejs to develop apis
Sure, you can do that with sqlite database or pouchDB. If you don't want to write long queries for sqlite then you can use Prisma sqlite. then after just store it in the local database (sqlite or pouchDB) whenever the system is offline. and whenever the system will become online post the last data to your SQL/Postgres/Mongo server.
Related
I am running node.js server side with MongoDB and I like the use of the NoSQL databases as it is easy to run with.
The android app I am creating stores data into the database from Node.js when it is online, but I want to have a functionality to retrive data offline from the DB?
I have a app.post set up, but I am still not sure how to communicate server-side offline?
You can't communicate server when off-line.
Suggestion : When sever is off-line you have to store data in android database.
i am developing offline web app for android platform and i want to use offline database for it. Is there any way to connect to locally stored database through javascript. like
var db = opendatabase("file:///android_asset/myLocalDb.db");
var Records = db.executeSQL("Select * form myTable");
echo Records;
I use PouchDB. It is a NoSQL type database backend, but has great cross platform support so you don't have to worry about the underlying storage mechanism across browsers. If you have flexibility on the database type, it may be the easiest solution.
Are you making a Cordova app, or in-browser hybrid offline but specifically targeting Android? You can use SQL Lite with Cordova and bubble up from your Javascript to access the db. Check out: https://stackoverflow.com/a/26609184/1011603
Yes, it is possible to package your application and data file as web app by packaging appcache. Since browser manage data storage for database (indexeddb or websql), it is not possible to specify them by your file name.
I'm making a web app and I need to store some data into a database that can also be accessed with Qt. What I need is to insert values from the web app and the app created with Qt.
I'm storing the info that comes from the web app in a WebSql database with javascript in Linux Mint.
I wan't to know if it is possible to access that database file with Qt.
Are there a better alternative to do this without a server-side languages?
Yes you can access the websql database with Qt. The websql database is just a sqlite database so there is no problem accessing it with Qt.
The tricks are finding the location and name of the file. In Chrome on my Mac, for example, the database is at
~/Library/Application Support/Google/Chrome/Default/Databases/mysite/1
there is a master database of the other databases at
~/Library/Application Support/Google/Chrome/Default/Databases/Databases.db
It is also sqlite and you can read it to find the other databases.
So I'm building web apps or website using laravel as php backend and bootstrap for frontend and using mysql (phpmyadmin) database from hosting service. so because in my country internet connection is bad i thinking a way of making my website to be available or can be used without internet connection , so it will be like this
When bad or no internet connection my website will load local data like html,js,css and also database mysql from local machine
When internet connection is good or available my website will load data like html,js,css and also sync database mysql (phpmyadmin) from local machine into hosting service or otherwise
So how to achieve that?
Use a Service Worker to mediate your front-end network connections and store data locally when no connection is available.
If you just need to sync database to remote host, you can use the MySQL replication setup.
http://dev.mysql.com/doc/refman/5.7/en/replication.html
The FAQ has already told you that the connection doesn't need to be always available
https://dev.mysql.com/doc/refman/5.5/en/faqs-replication.html
Hope this helps.
I want to maintain local sqlite database in MobileFirst platform.I tried with sql adapter. But its not successful. I dnt get what r the actually step or procedure for that.
Plz help me for that and suggest any tutorial which will helps to understand actual process for that...
A local SQLite database in your application has got nothing to do with SQL adapters. Adapters are a conduit allowing you to send and retrieve data from a remote backend, not local in the device.
If you want to use SQLite you will likely need to use either a Cordova plug-in or use the Send Action API to interact with Java code in your app.
Read about SQLite (I'm assuming Android here...): http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html
Read about creating Cordova plug-ins for IBM MobileFirst: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-0/adding-native-functionality/
Read about Send Action API: http://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.dev.doc/devref/c_action_sender.html