MCPcopy Index your code
hub / github.com/codedogQBY/ReadAny / deleteThread

Function deleteThread

packages/core/src/db/thread-queries.ts:120–133  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

118}
119
120export async function deleteThread(id: string): Promise<void> {
121 const database = await getDB();
122 // Get all message IDs in this thread for tombstones
123 const messages = await database.select<{ id: string }>(
124 "SELECT id FROM messages WHERE thread_id = ?",
125 [id],
126 );
127 for (const msg of messages) {
128 await insertTombstone(database, msg.id, "messages");
129 }
130 await insertTombstone(database, id, "threads");
131 await database.execute("DELETE FROM messages WHERE thread_id = ?", [id]);
132 await database.execute("DELETE FROM threads WHERE id = ?", [id]);
133}
134
135export async function deleteThreadsByBookId(bookId: string): Promise<void> {
136 const database = await getDB();

Callers 2

deleteThreadsByBookIdFunction · 0.85

Calls 3

getDBFunction · 0.90
insertTombstoneFunction · 0.90
executeMethod · 0.65

Tested by

no test coverage detected