(thread: Thread)
| 74 | } |
| 75 | |
| 76 | export async function insertThread(thread: Thread): Promise<void> { |
| 77 | const database = await getDB(); |
| 78 | const deviceId = await getDeviceId(); |
| 79 | const syncVersion = await nextSyncVersion(database, "threads"); |
| 80 | await database.execute( |
| 81 | "INSERT INTO threads (id, book_id, title, created_at, updated_at, sync_version, last_modified_by) VALUES (?, ?, ?, ?, ?, ?, ?)", |
| 82 | [ |
| 83 | thread.id, |
| 84 | thread.bookId || null, |
| 85 | thread.title, |
| 86 | thread.createdAt, |
| 87 | thread.updatedAt, |
| 88 | syncVersion, |
| 89 | deviceId, |
| 90 | ], |
| 91 | ); |
| 92 | } |
| 93 | |
| 94 | export async function updateThreadMemory( |
| 95 | id: string, |
no test coverage detected