I'm creating a web app using meteorJS which will use the backup data from a third party app. This backed up data is in sqlite db format.
What is the best way to copy this sqlite db from dropbox and use it in meteorJS app.
So far I have tried to create a Java rest API which would parse this data and create a text file which meteors can use but I'm looking for a easier MeteorJS based solution if possible.
Here is a node.js package that can migrate sqlite to mongo:
https://github.com/davidyaha/sqlite-to-mongo
https://www.npmjs.com/package/sqlite-to-mongo
You should be able to use this to migrate the data to mongo and then use Meteor on top of that. I am not aware of any mainstream approaches to using sqlite with Meteor directly. Here would be an example on how to do the migration:
const SqliteToMongo = require('sqlite-to-mongo');
var importer = new SqliteToMongo('db.sqlite', 'mongodb://localhost/dbname');
importer.importCollection('users', {
tableName : "USERS_TABLE",
columns: {
ID: '_id',
USERNAME: 'username',
EMAIL : 'profile.email'
}
});
db.sqlite is going to be your sqlite database and mongodb://localhost/dbname will be your local mongo collection. If you are already running meteor, then that will be:
mongodb://localhost:27017/dbname
Where dbname is your database name. The second part is where you would migrate individual tables, where 'users' is the mongo collection (table) and USERS_TABLE is the sqlite table. The last bit is mapping the sqlite columns to fields in mongo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With