feat: support concurrent Reddit accounts

This commit is contained in:
jjbrunton committed 2026-08-08 19:00:38 +01:00
1 parent d819a0f1e6
commit 16a31335d0
51 files changed
+3241 -250

No files matched your search

+4 -3
View File
@@ -106,8 +106,8 @@ describe('Database Client', () => {
const tables = db
.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'")
.all() as { name: string }[];
// Eight domain tables plus the singleton application configuration table.
expect(tables.length).toBe(9);
// Existing domain/config tables plus account, conversation, sync and media ownership stores.
expect(tables.length).toBe(13);
});
it('tracks schema version and migrates a legacy sent_messages table transactionally', () => {
@@ -138,7 +138,8 @@ describe('Database Client', () => {
const columns = db.prepare('PRAGMA table_info(processed_posts)').all() as { name: string; notnull: number }[];
const columnMap = new Map(columns.map(c => [c.name, c]));
expect(columnMap.get('id')?.notnull).toBe(0); // TEXT is not NOT NULL by default
expect(columnMap.get('account_id')?.notnull).toBe(1);
expect(columnMap.get('id')?.notnull).toBe(1); // Composite account-scoped primary key
expect(columnMap.get('subreddit')?.notnull).toBe(1);
expect(columnMap.get('author')?.notnull).toBe(1);
expect(columnMap.get('title')?.notnull).toBe(1);