this.db.create(ConectionDBName.connectionDB).then((db: any) => { let dbInstance = db._objectInstance; let sqlJsonBlock = { "data":{ "inserts":{ "stepsumassure": objMs } } }; this.sqlitePorter.importJsonToDb(dbInstance, sqlJsonBlock).then( () => { let num: number = SQLiteHandle.recordBeWrite SQLiteHandle.recordBeWrite = Number(num + objMs.length); }, (err) => { console.log("******************* stepsumassure " + JSON.stringify(err)); reject(err); } ); });
this.db.create(ConectionDBName.connectionDB).then((db: any) => { let dbInstance = db._objectInstance; // we can pass db._objectInstance as the database option in all SQLitePorter methods let sqlJsonBlock = { "data":{ "inserts":{ "district": districtMs } } }; this.sqlitePorter.importJsonToDb(dbInstance, sqlJsonBlock).then( () => { let num: number = SQLiteHandle.recordBeWrite; SQLiteHandle.recordBeWrite = Number(num + districtMs.length); }, (err) => { console.log("********************** districtMs" + JSON.stringify(err)); reject(err); } ); });