Saturday, 2 April 2022

Can local .db files be opened with Expo-Sqlite?

I'm building a react native application on mobile (IOS and Android) with Expo and already have a .db file created from SQLite in which to make transactions with.

I've seen examples of projects which call a remote database from an API call as well as create a database if it does not exist already, but it's not clear if this can open a local database file in my project. So far providing a filepath for the .db file is not able to be found.

import * as SQLite from 'expo-sqlite';

const path = './SQLite/TFData.db';

const db = SQLite.openDatabase(path);

If this is not an error on my part, I would like to know what can be done to read an existing database file that is already located in my project if expo-sqlite is not able to do this.



from Can local .db files be opened with Expo-Sqlite?

No comments:

Post a Comment