You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
795 B
31 lines
795 B
import * as SQLite from "expo-sqlite";
|
|
|
|
function openDatabase() {
|
|
const db = SQLite.openDatabase("db.testDb");
|
|
|
|
// return undefined
|
|
return db;
|
|
}
|
|
|
|
export default openDatabase;
|
|
|
|
// Snippet from docs:
|
|
// https://docs.expo.io/versions/latest/sdk/sqlite/#importing-an-existing-database
|
|
// async function openDatabase() {
|
|
// if (
|
|
// !(await FileSystem.getInfoAsync(
|
|
// FileSystem.documentDirectory + "SQLite"
|
|
// ).then(exists))
|
|
// // .exists
|
|
// ) {
|
|
// await FileSystem.makeDirectoryAsync(
|
|
// FileSystem.documentDirectory + "SQLite"
|
|
// );
|
|
// }
|
|
// await FileSystem.downloadAsync(
|
|
// Asset.fromModule(require("../assets/ddl.sqlite3.db")).uri,
|
|
// FileSystem.documentDirectory + "SQLite/wp6.db"
|
|
// );
|
|
|
|
// return SQLite.openDatabase("wp6.db");
|
|
// }
|