MCPcopy Create free account
hub / github.com/cloudflare/computer / chunkRows

Function chunkRows

packages/dofs/src/fs/writeFile.test.ts:41–48  ·  view source on GitHub ↗
(db: Database, path: string)

Source from the content-addressed store, hash-verified

39}
40
41function chunkRows(db: Database, path: string): Array<{ hash: Uint8Array; size: number }> {
42 const node = resolveInode(db, path);
43 if (node === null) throw new Error(`no such path: ${path}`);
44 return db.all<{ hash: Uint8Array; size: number }>(
45 "SELECT hash, size FROM vfs_chunks WHERE inode = ? ORDER BY idx",
46 node.inode,
47 );
48}
49
50function countBlobs(db: Database): number {
51 return db.scalar<number>("SELECT COUNT(*) FROM vfs_blobs") ?? 0;

Callers 1

writeFile.test.tsFile · 0.70

Calls 2

resolveInodeFunction · 0.85
allMethod · 0.80

Tested by

no test coverage detected