Documentation
¶
Overview ¶
package interpreter provides a basic interpreter for Kuneiform procedures. It allows running procedures as standalone programs (instead of generating PL/pgSQL code).
Index ¶
- type ThreadSafeInterpreter
- func (t *ThreadSafeInterpreter) Call(ctx *common.EngineContext, db sql.DB, namespace string, action string, ...) (*common.CallResult, error)
- func (t *ThreadSafeInterpreter) CallWithoutEngineCtx(ctx context.Context, db sql.DB, namespace string, action string, args []any, ...) (*common.CallResult, error)
- func (t *ThreadSafeInterpreter) Execute(ctx *common.EngineContext, db sql.DB, statement string, params map[string]any, ...) error
- func (t *ThreadSafeInterpreter) ExecuteWithoutEngineCtx(ctx context.Context, db sql.DB, statement string, params map[string]any, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ThreadSafeInterpreter ¶
type ThreadSafeInterpreter struct {
// contains filtered or unexported fields
}
ThreadSafeInterpreter is a thread-safe interpreter. It is defined as a separate struct because there are time where the interpreter recursively calls itself, and we need to avoid deadlocks.
func NewInterpreter ¶
func NewInterpreter(ctx context.Context, db sql.DB, service *common.Service, accounts common.Accounts, validators common.Validators, nsr engine.NamespaceRegister) (*ThreadSafeInterpreter, error)
NewInterpreter creates a new interpreter. It reads currently stored namespaces and loads them into memory.
func (*ThreadSafeInterpreter) Call ¶
func (t *ThreadSafeInterpreter) Call(ctx *common.EngineContext, db sql.DB, namespace string, action string, args []any, resultFn func(*common.Row) error) (*common.CallResult, error)
func (*ThreadSafeInterpreter) CallWithoutEngineCtx ¶
Click to show internal directories.
Click to hide internal directories.