MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / DeleteWorkspace

Method DeleteWorkspace

internal/store/workspaces.go:255–269  ·  view source on GitHub ↗
(slug string)

Source from the content-addressed store, hash-verified

253}
254
255func (s *Store) DeleteWorkspace(slug string) error {
256 ts := now()
257 result, err := s.db.Exec(s.q(`
258 UPDATE workspaces SET deleted_at = ?, updated_at = ?
259 WHERE slug = ? AND deleted_at IS NULL
260 `), ts, ts, slug)
261 if err != nil {
262 return err
263 }
264 rows, _ := result.RowsAffected()
265 if rows == 0 {
266 return sql.ErrNoRows
267 }
268 return nil
269}
270
271// RestoreWorkspace un-soft-deletes a workspace: it clears deleted_at so
272// the workspace (and every item/collection/member/attachment that was

Calls 3

qMethod · 0.95
nowFunction · 0.85
ExecMethod · 0.80