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

Function getBlockData

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

getBlockData returns the block data for a single block.

(e sqlExecutor, inodeID uint64, block int)

Source from the content-addressed store, hash-verified

92
93// getBlockData returns the block data for a single block.
94func getBlockData(e sqlExecutor, inodeID uint64, block int) ([]byte, error) {
95 var data []byte
96 const sql = `SELECT data FROM fs_block WHERE id = ? AND block = ?`
97 if err := e.QueryRow(sql, inodeID, block).Scan(&data); err != nil {
98 return nil, err
99 }
100 return data, nil
101}
102
103// updateBlockData overwrites the data for a single block.
104func updateBlockData(e sqlExecutor, inodeID uint64, block int, data []byte) error {

Callers 3

shrinkFunction · 0.85
growFunction · 0.85
writeFunction · 0.85

Calls 2

QueryRowMethod · 0.80
ScanMethod · 0.45

Tested by

no test coverage detected