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

Method updateDeleted

runtime/catalog_cache.go:386–400  ·  view source on GitHub ↗

updateDeleted sets the deleted_on field of a resource (a soft delete). Afterwards, the resource can still be accessed by passing withDeleted to the getters.

(name *runtimev1.ResourceName)

Source from the content-addressed store, hash-verified

384// updateDeleted sets the deleted_on field of a resource (a soft delete).
385// Afterwards, the resource can still be accessed by passing withDeleted to the getters.
386func (c *catalogCache) updateDeleted(name *runtimev1.ResourceName) error {
387 r, err := c.get(name, false, true)
388 if err != nil {
389 return err
390 }
391 c.unlink(r)
392 r.Meta.DeletedOn = timestamppb.Now()
393 r.Meta.Version++
394 r.Meta.SpecVersion++
395 r.Meta.SpecUpdatedOn = timestamppb.Now()
396 c.link(r)
397 c.dirty[nameStr(r.Meta.Name)] = r.Meta.Name
398 c.addEvent(r.Meta.Name, r, runtimev1.ResourceEvent_RESOURCE_EVENT_WRITE)
399 return nil
400}
401
402// updateStatus updates the ephemeral status fields on a resource.
403// The values of these fields are reset next time a catalog cache is created.

Callers 3

DeleteMethod · 0.80
safeMutateRenamedMethod · 0.80
safeRenameMethod · 0.80

Calls 5

getMethod · 0.95
unlinkMethod · 0.95
linkMethod · 0.95
addEventMethod · 0.95
nameStrFunction · 0.85

Tested by

no test coverage detected