MoneyDB.js 561 Bytes
Newer Older
Choi Ga Young's avatar
Choi Ga Young committed
1
2
3
import { DEBUG, enablePromise, openDatabase } from 'react-native-sqlite-storage';
import { View, SafeAreaView, Text, StyleSheet, Button, TextInput } from 'react-native';
import React, { useEffect, useState } from 'react';
Choi Ga Young's avatar
Choi Ga Young committed
4

Choi Ga Young's avatar
Choi Ga Young committed
5
6
DEBUG(true);
enablePromise(true);
Choi Ga Young's avatar
Choi Ga Young committed
7

Choi Ga Young's avatar
Choi Ga Young committed
8
9
10
const db = openDatabase({
  name: 'MyMoney',
  location: 'default',
Soo Hyun Kim's avatar
Soo Hyun Kim committed
11
  createFromLocation: '~MyMoney.db', // android/src/main/assets/TestDB.db 파일을 위치 시킴
Choi Ga Young's avatar
Choi Ga Young committed
12
});
Choi Ga Young's avatar
Choi Ga Young committed
13

14
15
16
const QueryFunc = async (Query) => {
  (await db).transaction(Query)
};
Choi Ga Young's avatar
Choi Ga Young committed
17

18
19
const moneyApi = {
  QueryFunc,
Choi Ga Young's avatar
Choi Ga Young committed
20
21
}

22
export default moneyApi