Mysql to sqlite sync or export

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
vedus
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 153
Joined: Tue Feb 26, 2013 9:23 am

Mysql to sqlite sync or export

Post by vedus » Sat Nov 01, 2014 10:18 pm

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
Last edited by vedus on Sun Nov 02, 2014 7:02 pm, edited 1 time in total.

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: Mysql to sqlite sync

Post by Da_Elf » Sun Nov 02, 2014 12:22 am

maybe you can setup a php webapp for that. I was going to go with sqlite but decided to just install mysql locally

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Mysql to sqlite sync or export

Post by Mark » Mon Nov 03, 2014 9:08 am

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
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply