Hi,
I am trying to download a sqlite db file from the internet by using FileSystem.donwloadAsync, but it seems that the line got skipped or something, as the only output at the terminal is ‘test’ below the FileSystem.downloadAsync
here is my code to donwload the .db file from the server:
FileSystem.downloadAsync('http://multidayacipta.com/realApt/db/obat.db', `${FileSystem.documentDirectory}/SQLite/obat.db`)
.then(({ status }) => {
console.log(status);
const db = SQLite.openDatabase('obat.db');
db.transaction((tx) => {
tx.executeSql('select * from item',
[],
(_, { rows }) => {
console.log(rows._array);
});
});
})
.catch((error) => {
console.log(error);
});
console.log("test");
this is the output from the logcat if it helps : https://pastebin.com/wa47WD1c
this is the snack url : https://snack.expo.io/@blankon/download-db-files
thanks in advance