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.
Related
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.
I'm developing disktop app using electron I want to store my data loclly within the app (no internet connection) I installed mysql using node js it worked but only if my laotop is connected to the internent
You are writing html5 to create the application. Now you need to think what html5 provides to store data and it would be localStorage, WebSql and IndexedDB.
You can store data in mysql too but you need to install the mysql at users computer and it would be hard to create a package including mysql which will install mysql, return the right port so that you can use inside your electron application.
Now from three options (localStorage, WebSql and IndexedDB) - WebSql is deprecated , so you should not use it. localStorage is only good for storing data in terms of key and value with fix length. So the last option would be indexeddb.
So you should store data in indexeddb, although there are others options like - sqllite etc which you can use it using some third party driver.
If you find indexeddb difficult to use, consider using any of indexeddb library. Check the example for storing data in electron using indexeddb library jsstore - https://github.com/ujjwalguptaofficial/JsStore/tree/master/examples/electron
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 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
Im trying to view database on my web app. The problem here is that it does not view from SQLite. rather view database from chrome add-ons. Is there any way for me to view SQlite databse using Jscript?
There is no way to directly access an arbitrary SQLite database via client side JavaScript running in a web browser.
If your database exists on a webserver, then you can write an HTTP based API (ideally one that is RESTful) and interact with it via the XMLHttpRequest object.