Page 1 of 1

Mysql to sqlite sync or export

Posted: Sat Nov 01, 2014 10:18 pm
by vedus
i will try to reproduce my question..
App is already in the Google play store.
sqlite database in the mobile have 500 customers and is only 100 kb.
My customer put 10 records per day in the mysql database. (database exist on sharing hosting now)
Now every week i go and export the data to csv and import to sqlite manual.(that mean delay to the customer update,and updates to app every week.)
My question
is possible to export the data from mysql with (livecode server) if i buy dedicated server and use the livecode server? >>if yes how-to ?
Is possible to import a csv file with coding to the sqlite and update the data? >>if yes how-to ?
thank you

Re: Mysql to sqlite sync

Posted: Sun Nov 02, 2014 12:22 am
by Da_Elf
maybe you can setup a php webapp for that. I was going to go with sqlite but decided to just install mysql locally

Re: Mysql to sqlite sync or export

Posted: Mon Nov 03, 2014 9:08 am
by Mark
Hi,

Of course, this is easy. Use SQL syntax in a LiveCode script to create a dump of the data. You could try something like this:

Code: Select all

get shell('mysqldump --user=... --password=... --host=... DB_NAME > /path/to/output/file.sql');
Then use the put URL command to download the sql file. Use another script to manipulate the SQL commands and use SQLite's import ability to load the modified sql file. You can also use mysqldump to export to a csv file and import the same way you to now, but by script.

Kind regards,

Mark