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

Method NewRecord

server/plpgsql/interpreter_stack.go:176–188  ·  view source on GitHub ↗

NewRecord creates a new record in the current scope. If a record with the same name exists in a previous scope, then that record will be shadowed until the current scope exits.

(name string, sch sql.Schema, val sql.Row)

Source from the content-addressed store, hash-verified

174// NewRecord creates a new record in the current scope. If a record with the same name exists in a previous scope, then
175// that record will be shadowed until the current scope exits.
176func (is *InterpreterStack) NewRecord(name string, sch sql.Schema, val sql.Row) {
177 // TODO: this is currently implemented only for the specific record types used in triggers: OLD and NEW
178 var newVal sql.Row
179 if val != nil {
180 newVal = make(sql.Row, len(val))
181 copy(newVal, val)
182 }
183 is.stack.Peek().variables[name] = &interpreterVariable{
184 Record: sch,
185 Type: pgtypes.Trigger, // TODO: we need to implement the RECORD pseudotype and replace the TRIGGER type here
186 Value: newVal,
187 }
188}
189
190// NewVariable creates a new variable in the current scope. If a variable with the same name exists in a previous scope,
191// then that variable will be shadowed until the current scope exits.

Callers 2

TriggerCallFunction · 0.95
AppendOperationsMethod · 0.80

Calls 1

PeekMethod · 0.45

Tested by

no test coverage detected