interpreter

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

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

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

func (t *ThreadSafeInterpreter) CallWithoutEngineCtx(ctx context.Context, db sql.DB, namespace string, action string, args []any, resultFn func(*common.Row) error) (*common.CallResult, error)

func (*ThreadSafeInterpreter) Execute

func (t *ThreadSafeInterpreter) Execute(ctx *common.EngineContext, db sql.DB, statement string, params map[string]any, fn func(*common.Row) error) error

func (*ThreadSafeInterpreter) ExecuteWithoutEngineCtx

func (t *ThreadSafeInterpreter) ExecuteWithoutEngineCtx(ctx context.Context, db sql.DB, statement string, params map[string]any, fn func(*common.Row) error) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL