MCPcopy
hub / github.com/pocketbase/pocketbase / DeleteTable

Method DeleteTable

core/db_table.go:89–96  ·  view source on GitHub ↗

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

(dangerousTableName string)

Source from the content-addressed store, hash-verified

87// NB! Be aware that this method is vulnerable to SQL injection and the
88// "dangerousTableName" argument must come only from trusted input!
89func (app *BaseApp) DeleteTable(dangerousTableName string) error {
90 _, err := app.NonconcurrentDB().NewQuery(fmt.Sprintf(
91 "DROP TABLE IF EXISTS {{%s}}",
92 dangerousTableName,
93 )).Execute()
94
95 return err
96}
97
98// HasTable checks if a table (or view) with the provided name exists (case insensitive).
99// in the data.db.

Callers

nothing calls this directly

Calls 3

NonconcurrentDBMethod · 0.95
ExecuteMethod · 0.80
NewQueryMethod · 0.80

Tested by

no test coverage detected