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

Function nextUpdatedAt

packages/core/src/db/db-core.ts:289–306  ·  view source on GitHub ↗
(
  database: IDatabase,
  table: string,
  id: string,
)

Source from the content-addressed store, hash-verified

287}
288
289export async function nextUpdatedAt(
290 database: IDatabase,
291 table: string,
292 id: string,
293): Promise<number> {
294 const now = Date.now();
295
296 try {
297 const rows = await database.select<{ updated_at: number | null }>(
298 `SELECT updated_at FROM ${table} WHERE id = ?`,
299 [id],
300 );
301 const current = rows[0]?.updated_at ?? 0;
302 return Math.max(now, current + 1);
303 } catch {
304 return now;
305 }
306}
307
308/** Insert a tombstone record for sync deletion tracking */
309export async function insertTombstone(

Callers 10

updateNoteFunction · 0.90
updateThreadMemoryFunction · 0.90
updateThreadTitleFunction · 0.90
updateHighlightFunction · 0.90
upsertSkillFunction · 0.90
updateSkillFunction · 0.90
updateBookFunction · 0.90
deleteBookFunction · 0.90
updateReadingSessionFunction · 0.90
updateGroupFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected