MCPcopy Create free account
hub / github.com/cortexproject/cortex / SetDeletedAtConfig

Method SetDeletedAtConfig

pkg/configs/db/postgres/postgres.go:305–315  ·  view source on GitHub ↗

SetDeletedAtConfig sets a deletedAt for configuration by adding a single new row with deleted_at set the same as SetConfig is actually insert

(ctx context.Context, userID string, deletedAt sql.NullTime, cfg userconfig.Config)

Source from the content-addressed store, hash-verified

303// by adding a single new row with deleted_at set
304// the same as SetConfig is actually insert
305func (d DB) SetDeletedAtConfig(ctx context.Context, userID string, deletedAt sql.NullTime, cfg userconfig.Config) error {
306 cfgBytes, err := json.Marshal(cfg)
307 if err != nil {
308 return err
309 }
310 _, err = d.Insert("configs").
311 Columns("owner_id", "owner_type", "subsystem", "deleted_at", "config").
312 Values(userID, entityType, subsystem, deletedAt, cfgBytes).
313 Exec()
314 return err
315}
316
317// DeactivateConfig deactivates a configuration.
318func (d DB) DeactivateConfig(ctx context.Context, userID string) error {

Callers 2

DeactivateConfigMethod · 0.95
RestoreConfigMethod · 0.95

Implementers 4

timedpkg/configs/db/timed.go
tracedpkg/configs/db/traced.go
DBpkg/configs/db/postgres/postgres.go
DBpkg/configs/db/memory/memory.go

Calls 3

InsertMethod · 0.80
ExecMethod · 0.65
MarshalMethod · 0.45

Tested by

no test coverage detected