Download src/lib/db.js from Arifzyn/buatkan-project-web-fullstack-bernama-s: direct link, hf CLI and curl.
- Browser
- Download file 488 Bytes
-
https://huggingface.co/spaces/Arifzyn/buatkan-project-web-fullstack-bernama-s/resolve/main/src/lib/db.js
- Command line
-
hf download hf://spaces/Arifzyn/buatkan-project-web-fullstack-bernama-s/src/lib/db.js
-
curl -L -o db.js https://huggingface.co/spaces/Arifzyn/buatkan-project-web-fullstack-bernama-s/resolve/main/src/lib/db.js
488 Bytes
| import Dexie from 'dexie'; | |
| export const db = new Dexie('ServiceBookDB'); | |
| db.version(1).stores({ | |
| transactions: '++id, userId, date, type, category, amount', | |
| syncQueue: '++id, action, payload, timestamp', | |
| settings: 'key' | |
| }); | |
| db.version(2).upgrade(trans => { | |
| return trans.table('transactions').toCollection().modify(transaction => { | |
| transaction.synced = false; | |
| transaction.updatedAt = new Date().toISOString(); | |
| }); | |
| }); | |
| // Export the database instance | |
| export default db; |