MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / allChunksFromSqlite

Function allChunksFromSqlite

src/context/sqlite-index.ts:204–210  ·  view source on GitHub ↗
(handle: SqliteIndexHandle)

Source from the content-addressed store, hash-verified

202
203/** Read every chunk's text (for BM25 in hybrid mode) without the vectors. */
204export function allChunksFromSqlite(handle: SqliteIndexHandle): Chunk[] {
205 const rows: any[] = handle.db.prepare('SELECT file,start_line,end_line,symbol,text,hash FROM chunks').all();
206 return rows.map((r: any) => ({
207 file: r.file, startLine: r.start_line, endLine: r.end_line,
208 symbol: r.symbol ?? undefined, text: r.text, hash: r.hash,
209 } as Chunk));
210}
211
212export function chunkCount(handle: SqliteIndexHandle): number {
213 const row: any = handle.db.prepare('SELECT COUNT(*) as n FROM chunks').get();

Callers 1

searchPersistedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected