MoneyDB.js 420 Bytes
Newer Older
Soo Hyun Kim's avatar
Soo Hyun Kim committed
1
import { DEBUG, enablePromise, openDatabase } from 'react-native-sqlite-storage';
Choi Ga Young's avatar
Choi Ga Young committed
2

Soo Hyun Kim's avatar
Soo Hyun Kim committed
3
4
DEBUG(true);
enablePromise(true);
Choi Ga Young's avatar
Choi Ga Young committed
5

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

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

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

20
export default moneyApi