interpreter

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: Apache-2.0 Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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