MCPcopy
hub / github.com/pocketbase/pocketbase / DeleteView

Method DeleteView

core/view.go:24–31  ·  view source on GitHub ↗

DeleteView drops the specified view name. This method is a no-op if a view with the provided name doesn't exist. NB! Be aware that this method is vulnerable to SQL injection and the "dangerousViewName" argument must come only from trusted input!

(dangerousViewName string)

Source from the content-addressed store, hash-verified

22// NB! Be aware that this method is vulnerable to SQL injection and the
23// "dangerousViewName" argument must come only from trusted input!
24func (app *BaseApp) DeleteView(dangerousViewName string) error {
25 _, err := app.DB().NewQuery(fmt.Sprintf(
26 "DROP VIEW IF EXISTS {{%s}}",
27 dangerousViewName,
28 )).Execute()
29
30 return err
31}
32
33// SaveView creates (or updates already existing) persistent SQL view.
34//

Callers

nothing calls this directly

Calls 3

DBMethod · 0.95
ExecuteMethod · 0.80
NewQueryMethod · 0.80

Tested by

no test coverage detected