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

Method AddDatabase

backend/store/model/changed_resources.go:133–138  ·  view source on GitHub ↗

AddDatabase records a database changed by a non-table-object write (Tier 2): a qualified object DDL (CREATE/ALTER/DROP VIEW/PROCEDURE/FUNCTION/TRIGGER/...) whose only auth-relevant identity is its target database. Auth-only; not surfaced in Build().

(database string)

Source from the content-addressed store, hash-verified

131// object DDL (CREATE/ALTER/DROP VIEW/PROCEDURE/FUNCTION/TRIGGER/...) whose only auth-relevant
132// identity is its target database. Auth-only; not surfaced in Build().
133func (r *ChangedResources) AddDatabase(database string) {
134 if r.databaseOnly == nil {
135 r.databaseOnly = make(map[string]bool)
136 }
137 r.databaseOnly[database] = true
138}
139
140// GetDatabaseOnlyTargets returns the databases recorded via AddDatabase (non-table-object
141// write targets). Used by the SQL-editor write-authorization path.

Callers 4

extractChangedResourcesFunction · 0.95
extractChangedResourcesFunction · 0.95
addObjectDatabaseMethod · 0.80
addTiDBObjectDatabaseFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected