MCPcopy
hub / github.com/codedogQBY/ReadAny / insertThread

Function insertThread

packages/core/src/db/thread-queries.ts:76–92  ·  view source on GitHub ↗
(thread: Thread)

Source from the content-addressed store, hash-verified

74}
75
76export 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
94export async function updateThreadMemory(
95 id: string,

Callers 1

Calls 4

getDBFunction · 0.90
getDeviceIdFunction · 0.90
nextSyncVersionFunction · 0.90
executeMethod · 0.65

Tested by

no test coverage detected