Blockquote
I also created database with table and store it into android/app/src/main/assets/sqlite.db and also set createFromLocation to 1 or 2
useEffect(() => {
try {
db = SQLite.openDatabase({
name: "sqlite.db",
createFromLocation:"~sqlite.db"
},
sucessToOpen,
errorToOpen
)
}
catch (err) {
console.log(err)
}
}, [])
....
const sucessToOpen = async (data) => {
console.log("DB connected",data)
db.transaction(tx => {
tx.executeSql(
'SELECT * FROM hydro',[],
(tx, results) => {
let datalength = results.row.length
alert(datalength)
console.log("results",datalength)
},
)
});
}
This work for me