sqlitereact-nativeexporeact-native-sqlite-storage

How to use sqlite file in expo react native


am using expo 0.62 i have a project to take one else project an android studio java project and convert it into react native project he uses database as database.sqlite i want to know if it is possible for me to get data from that file the packages to do that i found were react-native-sqlite-storage but i get error for this like imported like

import {openDatabase} from 'react-native-sqlite-storage';
const db = openDatabase({name:'database.sqlite'});
export const getStories = props => {
    
    console.log(db);
};```
 

```TypeError: null is not an object (evaluating 'NativeModules["SQLite"][method]')```

does it mean i can't use it in expo and have to eject can anyone tell me to get data from .sqlite format file in expo   

Solution

  • If you use expo for your project, you can use Expo-SQLite, it's easy to install and using.