Cloud Base Sqlite Database in Livecode - sqlite

I am working on a Livecode Aapplication. In this I need to use cloud base sqlite database. But I have not much knowledge about cloud base sqlite and how to implement it with Livecode Application. Could anyone explain to me, what is it and how can I use cloud base sqlite into Livecode?
Thanks

An SQLite database is just a file which resides in the file system of the device. So each device will have its own database with its own data. If you want to store data in the cloud you have to do something on the server side.
If you want to have a solution on the server you might want to go for a PHP script. PHP has sqlite access built in. However you can use other scripting languages as well.
Or on another line something like https://cloudant.com/ . But there the data is not stored in relational tables but as JSON objects. Access is as well through the http protocol (restful).
Related question
See also here How to retrieve data from a server
Suggestion
Please do not forget to use the search box of this web site. E.g. by searching for
sqlite cloud
you get
https://stackoverflow.com/search?q=sqlite+cloud
which has as the first answer
A: Can I use the SQLite as a db storage for cloud-based websites?
So your question needs to be more specific.

Related

How to encrypt SQLite DB in an electron app?

I have an electron app which persists data in an SQLite db stored in my machine. I have all the setup for the CRUD operation and the application works fine. Now I need to encrypt the SQLite DB file. I searched online for solution but all the solution are for pre-encrypted DB which is being decrypted inside Electron.
The requirement is, user will provide the password using which the app will encrypt the DB file and going forward user will provide the password to decrypt and perform the CRUD operation
Any idea how to achieve this?
P.S.: I have checked with SQLCipher docs and I don't find what I needed. So far, I am using sqlite3 node module to perform CRUD
Edit 1: I tried to use sqlite-cipher module and I was able to encrypt the db in a separate js file. but when I integrate the same with the electron ipcMain, the app closes due to high RAM consumption.
Any suggestions???
If you're using SQLite the best option is use SQLCipher. The problem is that you will have to compile new binaries to work and there are some limitations with the versions of SQLite and SQLcipher for node.
You can use this package: https://github.com/journeyapps/node-sqlcipher
or compiling manually, here you have an example https://gist.github.com/aguynamedben/14253e34bc7e0a881d99c8e45eb45a47
Encryption in electron app is a tricky thing.
This is because it can give you false sense of security.
You might encrypt your local db, but with electron it's so easy to decrypt it back that perhaps it's not worth it at all?
It's very easy to get sources of your electron app. Minification helps only a little bit, but this is not real protection.
There are many approaches you can take but they vary on circumstances.
The questions which needs to be answered are:
who are you trying to protect against?
is security critical or this is only basic measures so not everyone can get data from db at first
glance?
does the user using the app have admin user rights on the
machine?
are you accessing db directly through electron app, or some
kind of system wide service (deamon) is communicating with db and
passing results to electron app.
if previous is "yes" how do you communicate the
service with the electron app and how is this secured?
Take a look at source code access discussion:
https://github.com/electron/electron/issues/3041
and also check this article (especially the security part):
https://hackernoon.com/electron-the-bad-parts-2b710c491547

Phonegap Local SQLite to remote MySQL

I'm making an in-house application for a company and they want me to use Phonegap for the mobile application. After searching, I decided to go on and use SQLite plugin for the local storage but they have this requirement that when the device goes online all the data on the local storage will synced automatically to the remote MYSql db. I read about deferred functions in jQuery but I'm not quite familiar on how to use them.
Are there any alternatives to achieve this requirement?
I'm currently investigating to achieve a similar goal.
I need to develop an IONIC/Phonegap app that can potentially do CRUD operations with the followings DB engines: MySQL / Postgres / Microsoft SQL Server / Oracle (not simultaneously).
TypeORM seems to be the solution, but I still couldn't connect from Android device to remote MySQL DB.
If you work with TypeORM over NodeJS directly is very easy to have an example up and running and do some CRUD operations with the supported DB engines (just follow the examples and documentation in the previous link).
I'm asking at https://github.com/typeorm/typeorm/issues/548 if anybody has achieved an Android-MySQL connection using TypeORM.

Pros/Con of Excel VBA v SQLite

I am recently working with a relational database program that has been written in Excel VBA. Excel VBA was chosen as it is a default application on computers where I work and therefore everyone would be able to use the database.
As part of the database development the need has arisen to add some more tables which will only interact programmatically with the current database. In order to consider all my options I am contemplating separating this new data either as an SQLite or second excel file.
I keep changing my mind as to what would be the best route and would appreciate information from those who work with the programs.
The new database would need to perform normal database functions quickly and efficiently. Given this context what are the advantages/disadvantages of using SQLite compared with excel?
Excel is not a database! If you want to use the Office applications, use Access, it is designed for that.
If you want to use SQLite, bear in mind that there is no concurrency. So if PC1 writes to the database, and PC2 wants to do that too, the file is locked by PC1 and you will get an error on PC2.
My recommendation:
You can also install SQL Server Express, this is free, with a few terms (10 concurrent users & max 10GB db). And then store your data in your SQL server. Use Excel as an interface to collect data from the SQL Server in your Excel/VBA applications. This is a lot more scale-able then Access, let alone SQLite.
OR: If your organization doesn't allow installation of software or whatever reason, go for Access.
You can use SQLite if you have a single application on a single device. Think about mobile apps, they use SQLite for example. If you have two applications on a single device, the concurrency problem of SQLite comes around the corner. It is possible that both apps want to write at the same time, which will give you an error.

How can I save a Microsoft Access database as .sqlite database?

Are there any add-ons or something that can enable Microsoft Access to save its database as .sqlite?
Or do you know of any other way I can convert them, both ways.
Thanx a lot
If you can find an application (libreoffice?) or language with bindings/reader to access or if you can convert the access "db" into something sane, it shouldn't be too difficult to go to sqlite from there. The code you need will probably be specific to your particular database and not a universal Access->sqlite converter.
Actually, you might see if access could directly talk to sqlite over ODBC. Longshot, but that might be closest to a full answer to your question.
You could see these, for starters:
What do I need to read Microsoft Access databases using Python?
how to deal with .mdb access files with python
SQLite Syntax Error In Union Select Query From MS-Access
How to use sqlite database from inside MS Access?
ODBC/JDBC resources
Bindings and libraries for your favourite languages

elgg database connection

I just started working on a social network site using elgg framework. I want to do a simple query to the mysql database to get data out of it. How is the best way to connect to the database to do some simple queries on it?
Thanks
In Elgg, most database interaction is handled through the core database functions. Here's a link to the top level documentation article about the Elgg database system: http://docs.elgg.org/wiki/Engine/DataModel
In general, direct database interaction is discouraged, but if the data you need to access is outside of Elgg's tables, then you would want to look at the functions contained in /engine/lib/database.php. There you will find functions to execute queries, etc.
And of course, since you are in PHP, you can also do standard PHP database calls.
You can use the get_data($query) function provided by Elgg.
It will return the formatted result as an array

Resources