thats-me/frontend/_src/db/index.js
2026-04-22 12:57:10 +02:00

17 lines
528 B
JavaScript

import Dexie from 'dexie'
export const db = new Dexie('thatsMeDB')
db.version(1).stores({
// Events: indexed by id (PK), date for sorted queries, syncStatus for dirty tracking
events: 'id, date, updatedAt, syncStatus',
// Sync queue: outbound mutations waiting to be pushed to server
syncQueue: '++queueId, eventId, action, createdAt',
// Image cache: offline blob storage for thumbnails
imageCache: 'url, eventId, type, cachedAt',
// Metadata: key-value pairs (lastSyncCursor, userId, etc.)
meta: 'key'
})