import { Query } from 'expo-sqlite'; import { StyleSheet, Text, View } from 'react-native'; import { addCategory, deleteDatabase, deleteExpenses, executeQuery, initDatabase } from '../../../services/database'; export default function Page() { const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'space-evenly', alignItems: 'center', }, text: { fontSize: 40, color: "yellow", } }); return ( { deleteExpenses().then(() => { console.log("Expenses Deleted!"); }) }}>Reset Expenses { deleteDatabase(); console.log("Database Deleted!"); }}>Reset Database { initDatabase().then(() => { console.log("Database Initialized!"); }); }}>Init Database { addCategory("Category", "green", "expense", 500).then(() => { const getCategoryQuery: Query = {sql: "SELECT guid FROM category", args: []}; executeQuery(getCategoryQuery).then((result) => { if("rows" in result[0]) { console.log(result[0]["rows"]); } }) console.log("Category added with success!"); }) }}>Add new Category Expense { addCategory("Category", "yellow", "saving", 420).then(() => { const getCategoryQuery: Query = {sql: "SELECT guid FROM category", args: []}; executeQuery(getCategoryQuery).then((result) => { if("rows" in result[0]) { console.log(result[0]["rows"]); } }) console.log("Category added with success!"); }) }}>Add new Category Savings ); }