import { DEBUG, enablePromise, openDatabase } from 'react-native-sqlite-storage';

DEBUG(true);
enablePromise(true);

const db = openDatabase({
  name: 'MyMoney',
  location: 'default',
  createFromLocation: '~MyMoney.db', // android/src/main/assets/TestDB.db 파일을 위치 시킴
});

const QueryFunc = async (Query) => {
  (await db).transaction(Query)
};

const moneyApi = {
  QueryFunc,
}

export default moneyApi