MCPcopy Create free account
hub / github.com/apecloud/myduckserver / SetValue

Method SetValue

pgserver/pgconfig/parameters.go:123–133  ·  view source on GitHub ↗

SetValue implements sql.SystemVariable.

(val any, global bool)

Source from the content-addressed store, hash-verified

121
122// SetValue implements sql.SystemVariable.
123func (p *Parameter) SetValue(ctx *sql.Context, val any, global bool) (sql.SystemVarValue, error) {
124 if global {
125 // This shouldn't happen, but sanity check
126 return sql.SystemVarValue{}, sql.ErrSystemVariableSessionOnly.New(p.Name)
127 }
128 if p.IsReadOnly() {
129 return sql.SystemVarValue{}, ErrCannotChangeAtRuntime.New(p.Name)
130 }
131 // TODO: Do parsing of units for memory and time parameters
132 return p.InitValue(ctx, val, global)
133}
134
135// IsReadOnly implements sql.SystemVariable.
136func (p *Parameter) IsReadOnly() bool {

Callers 1

setPgSessionVarMethod · 0.45

Calls 2

IsReadOnlyMethod · 0.95
InitValueMethod · 0.95

Tested by

no test coverage detected