MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / countRows

Function countRows

packages/core/src/query/__tests__/session-index.test.ts:109–112  ·  view source on GitHub ↗
(db: DatabaseAdapter, table: 'segment' | 'message_context')

Source from the content-addressed store, hash-verified

107}
108
109function countRows(db: DatabaseAdapter, table: 'segment' | 'message_context'): number {
110 const row = db.prepare(`SELECT COUNT(*) as count FROM ${table}`).get() as { count: number }
111 return row.count
112}
113
114function getMetaGapThreshold(db: DatabaseAdapter): number | null {
115 const row = db.prepare('SELECT session_gap_threshold FROM meta LIMIT 1').get() as {

Callers 1

Calls 2

getMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected