MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / ChangePrivileges

Method ChangePrivileges

agent/utils/postgresql/client/remote.go:167–173  ·  view source on GitHub ↗
(info Privileges)

Source from the content-addressed store, hash-verified

165}
166
167func (r *Remote) ChangePrivileges(info Privileges) error {
168 super := "SUPERUSER"
169 if !info.SuperUser {
170 super = "NOSUPERUSER"
171 }
172 return r.ExecSQL(fmt.Sprintf("ALTER USER \"%s\" WITH %s", info.Username, super), info.Timeout)
173}
174
175func (r *Remote) ChangePassword(info PasswordChangeInfo) error {
176 return r.ExecSQL(fmt.Sprintf("ALTER USER \"%s\" WITH ENCRYPTED PASSWORD '%s'", info.Username, info.Password), info.Timeout)

Callers 1

CreateUserMethod · 0.95

Calls 1

ExecSQLMethod · 0.95

Tested by

no test coverage detected