Spaces:
Running on Zero
Running on Zero
File size: 854 Bytes
ef6e870 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | /**
* Database-related constants (IndexedDB, Dexie).
*
* Centralized to ensure consistency across the app and simplify future
* naming changes.
*/
import { STORAGE_APP_NAME } from './storage';
/** IndexedDB database name */
export const DB_NAME = STORAGE_APP_NAME;
/** IndexedDB store / table names */
export const IDXDB_TABLES = {
conversations: 'conversations',
messages: 'messages'
} as const;
/** IndexedDB store schemas */
export const IDXDB_STORE_SCHEMAS = {
conversations: 'id, lastModified, currNode, name',
messages: 'id, convId, type, role, timestamp, parent, children'
} as const;
/** Combined Dexie stores definition — keys are table names, values are schemas */
export const IDXDB_STORES = {
[IDXDB_TABLES.conversations]: IDXDB_STORE_SCHEMAS.conversations,
[IDXDB_TABLES.messages]: IDXDB_STORE_SCHEMAS.messages
} as const;
|