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

Function getBlocksBetween

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

getBlocksBetween fetches blocks with IDs [start, end] for a given inode and returns a list of blockInfo objects.

(e sqlExecutor, inodeID uint64, start, end int)

Source from the content-addressed store, hash-verified

128// getBlocksBetween fetches blocks with IDs [start, end] for a given inode
129// and returns a list of blockInfo objects.
130func getBlocksBetween(e sqlExecutor, inodeID uint64, start, end int) ([]blockInfo, error) {
131 stmt := `SELECT block, data FROM fs_block WHERE id = ? AND block >= ? AND block <= ?`
132 rows, err := e.Query(stmt, inodeID, start, end)
133 if err != nil {
134 return nil, err
135 }
136 return buildBlockInfos(rows)
137}
138
139func buildBlockInfos(rows *sql.Rows) ([]blockInfo, error) {
140 var results []blockInfo

Callers 1

readFunction · 0.85

Calls 2

buildBlockInfosFunction · 0.85
QueryMethod · 0.65

Tested by

no test coverage detected