MCPcopy Create free account
hub / github.com/rilldata/rill / checkDeleteRow

Function checkDeleteRow

admin/database/postgres/postgres.go:3957–3973  ·  view source on GitHub ↗
(target string, res sql.Result, err error)

Source from the content-addressed store, hash-verified

3955}
3956
3957func checkDeleteRow(target string, res sql.Result, err error) error {
3958 if err != nil {
3959 return parseErr(target, err)
3960 }
3961 n, err := res.RowsAffected()
3962 if err != nil {
3963 return parseErr(target, err)
3964 }
3965 if n == 0 {
3966 return parseErr(target, sql.ErrNoRows)
3967 }
3968 if n > 1 {
3969 // This should never happen
3970 panic(fmt.Errorf("expected to delete 1 row, but deleted %d", n))
3971 }
3972 return nil
3973}
3974
3975func parseErr(target string, err error) error {
3976 if err == nil {

Callers 15

DeleteOrganizationMethod · 0.85
DeleteProjectMethod · 0.85
DeleteDeploymentMethod · 0.85
DeleteUserMethod · 0.85
DeleteUsergroupMethod · 0.85
DeleteUserAuthTokenMethod · 0.85
DeleteServiceMethod · 0.85
DeleteMagicAuthTokenMethod · 0.85

Calls 2

parseErrFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected