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

Function checkIsEmpty

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

checkIsEmpty returns nil if 'id' has no children.

(e sqlExecutor, id uint64)

Source from the content-addressed store, hash-verified

66
67// checkIsEmpty returns nil if 'id' has no children.
68func checkIsEmpty(e sqlExecutor, id uint64) error {
69 var count uint64
70 const countSQL = `
71SELECT COUNT(parentID) FROM fs_namespace WHERE parentID = ?`
72 if err := e.QueryRow(countSQL, id).Scan(&count); err != nil {
73 return err
74 }
75 if count != 0 {
76 return fuse.Errno(syscall.ENOTEMPTY)
77 }
78 return nil
79}
80
81// updateNode updates an existing node descriptor.
82func updateNode(e sqlExecutor, node *Node) error {

Callers 2

removeMethod · 0.85
validateRenameFunction · 0.85

Calls 2

QueryRowMethod · 0.80
ScanMethod · 0.45

Tested by

no test coverage detected