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

Function nextSyncVersion

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

Source from the content-addressed store, hash-verified

280
281/** Get next sync version for a table */
282export async function nextSyncVersion(database: IDatabase, table: string): Promise<number> {
283 const rows = await database.select<{ max_v: number | null }>(
284 `SELECT MAX(sync_version) as max_v FROM ${table}`,
285 );
286 return (rows[0]?.max_v || 0) + 1;
287}
288
289export async function nextUpdatedAt(
290 database: IDatabase,

Callers 15

insertNoteFunction · 0.90
updateNoteFunction · 0.90
insertThreadFunction · 0.90
updateThreadMemoryFunction · 0.90
updateThreadTitleFunction · 0.90
insertHighlightFunction · 0.90
updateHighlightFunction · 0.90
insertSkillFunction · 0.90
upsertSkillFunction · 0.90
updateSkillFunction · 0.90
insertBookFunction · 0.90
updateBookFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected