MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / getBlocks

Function getBlocks

cmd/cql-fuse/sql.go:119–126  ·  view source on GitHub ↗

getBlocks fetches all the blocks for a given inode and returns a list of blockInfo objects.

(e sqlExecutor, inodeID uint64)

Source from the content-addressed store, hash-verified

117// getBlocks fetches all the blocks for a given inode and returns
118// a list of blockInfo objects.
119func getBlocks(e sqlExecutor, inodeID uint64) ([]blockInfo, error) {
120 stmt := `SELECT block, data FROM fs_block WHERE id = ?`
121 rows, err := e.Query(stmt, inodeID)
122 if err != nil {
123 return nil, err
124 }
125 return buildBlockInfos(rows)
126}
127
128// getBlocksBetween fetches blocks with IDs [start, end] for a given inode
129// and returns a list of blockInfo objects.

Callers 1

getAllBlocksFunction · 0.85

Calls 2

buildBlockInfosFunction · 0.85
QueryMethod · 0.65

Tested by 1

getAllBlocksFunction · 0.68