MCPcopy Create free account
hub / github.com/bytebase/bytebase / DeleteWorkSheet

Method DeleteWorkSheet

backend/store/worksheet.go:272–282  ·  view source on GitHub ↗

DeleteWorkSheet deletes an existing sheet by resource ID. The worksheet_organizer rows are cascade-deleted via FK on worksheet(resource_id).

(ctx context.Context, resourceID string)

Source from the content-addressed store, hash-verified

270// DeleteWorkSheet deletes an existing sheet by resource ID.
271// The worksheet_organizer rows are cascade-deleted via FK on worksheet(resource_id).
272func (s *Store) DeleteWorkSheet(ctx context.Context, resourceID string) error {
273 q := qb.Q().Space(`DELETE FROM worksheet WHERE resource_id = ?`, resourceID)
274 query, args, err := q.ToSQL()
275 if err != nil {
276 return errors.Wrapf(err, "failed to build sql")
277 }
278 if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil {
279 return err
280 }
281 return nil
282}
283
284// WorksheetOrganizerMessage is the store message for worksheet organizer.
285type WorksheetOrganizerMessage struct {

Callers 1

DeleteWorksheetMethod · 0.80

Calls 4

GetDBMethod · 0.95
QFunction · 0.92
SpaceMethod · 0.80
ToSQLMethod · 0.80

Tested by

no test coverage detected