MCPcopy Create free account
hub / github.com/dolthub/doltgresql / dbName

Method dbName

server/auth/auth_handler.go:288–295  ·  view source on GitHub ↗

dbName uses the current database from the context if a database is not specified, otherwise it returns the given database name.

(ctx *sql.Context, dbName string)

Source from the content-addressed store, hash-verified

286// dbName uses the current database from the context if a database is not specified, otherwise it returns the given
287// database name.
288func (h *AuthorizationHandler) dbName(ctx *sql.Context, dbName string) string {
289 if len(dbName) == 0 {
290 dbName = ctx.GetCurrentDatabase()
291 }
292 // Revision databases take the form "dbname/revision", so we must split the revision from the database name
293 splitDbName := strings.SplitN(dbName, "/", 2)
294 return splitDbName[0]
295}
296
297// checkPrivilegeOnSchema checks privileges for given schema.
298func checkPrivilegeOnSchema(state AuthorizationQueryState, schemaName string, privileges []Privilege) error {

Callers 1

HandleAuthMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected