Home » Javascript » Import SQLite database into MySql with Node Js

Import SQLite database into MySql with Node Js

Posted by: admin August 19, 2018 Leave a comment

Questions:

i have tried different ways,
i tried shelljs for running these commands for generating CSV from SQLite DB,

shell.exec('sqlite3 /path/to/sqlite-db.db')
shell.exec('.headers on')
shell.exec('.mode csv');
shell.exec('.output /path/to/data.csv');
shell.exec('select * from Table;');
shell.exec('.quit');

but it get stuck on 1st command, i need to run all other commands in SQLite cmd.
On terminal these commands working fine.

Or is there any other way to do that?

Answers: