-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathindex.js
42 lines (36 loc) · 1.11 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* @format
*/
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import {
initializeDatabase,
testDb,
} from './Database/dbInitialization';
import { exportDatabase, shareDatabase } from './Database/dbExport';
import { getSlopeDataFromDB } from './Database/dbUtilities';
// import { getUsers } from './dbTesting.cjs';
AppRegistry.registerComponent(appName, () => App);
console.log("in index.js");
const setupDatabase = async () => {
try {
await initializeDatabase();
console.log('Database setup completed');
// uncomment to test the database
// await testDb();
} catch (error) {
console.error('Error setting up database:', error);
}
};
setupDatabase();
// uncomment to export the database
//.then(() => {
// console.log('### Database setup completed');
// return exportDatabase();
//}).then((exportPath) => {
// console.log('### Database export completed');
// return shareDatabase(exportPath); // //"/data/data/com.sealapplication7/databases/mydatabase.db"
//}).catch((error) => {
// console.error('### Error:', error);
//});