NewInterpreterStack creates a new InterpreterStack.
(runner sql.StatementRunner)
| 71 | |
| 72 | // NewInterpreterStack creates a new InterpreterStack. |
| 73 | func NewInterpreterStack(runner sql.StatementRunner) InterpreterStack { |
| 74 | stack := utils.NewStack[*InterpreterScopeDetails]() |
| 75 | // This first push represents the function base, including parameters |
| 76 | stack.Push(&InterpreterScopeDetails{ |
| 77 | variables: make(map[string]*interpreterVariable), |
| 78 | }) |
| 79 | return InterpreterStack{ |
| 80 | stack: stack, |
| 81 | runner: runner, |
| 82 | cursors: make(map[string]*cursorState), |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | // Details returns the details for the current scope. |
| 87 | func (is *InterpreterStack) Details() *InterpreterScopeDetails { |