localengine

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 15 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 localengine provides a strictly fail-closed, zero-cgo, pure-Go fallback tracedb.Engine backed by JSONL files (or in-memory storage).

This package is outside the compatibility promise of github.com/tmc/lib/nvidia. Its API may change or be removed in patch releases.

Package localengine provides a strictly fail-closed, zero-cgo, pure-Go fallback tracedb.Engine backed by JSONL files (or in-memory storage).

Any ClickHouse SQL construct that localengine cannot evaluate with exact ClickHouse semantics (such as quantile(), window functions OVER (...), HAVING, DISTINCT, UNION, subqueries, CASE/WHEN, CAST, arithmetic operators, functions in WHERE, or multi-table joins) is explicitly refused with tracedb.ErrUnsupportedLocalSQL rather than silently approximated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine is a zero-cgo, pure-Go ClickHouse-subset fallback engine implementing tracedb.Engine and tracedb.NamedEngine.

func New

func New(sessionDir string) (*Engine, error)

New creates or opens a local fallback engine for tracedb.DefaultDatabase stored in <sessionDir>/tracedb/ (or purely in memory when sessionDir == "").

func Open

func Open(sessionDir, db string) (*Engine, error)

Open creates or opens a local fallback engine for db stored in <sessionDir>/tracedb/ (or purely in memory when sessionDir == "").

func (*Engine) Close

func (e *Engine) Close() error

Close marks the engine closed.

func (*Engine) Database

func (e *Engine) Database() string

Database returns the session database configured for this engine.

func (*Engine) Databases

func (e *Engine) Databases() []string

Databases returns the single session database owned by this engine.

func (*Engine) EngineName

func (e *Engine) EngineName() string

EngineName returns tracedb.EngineLocalFallback ("local_fallback").

func (*Engine) Exec

func (e *Engine) Exec(ctx context.Context, sql string) error

Exec executes supported DDL (`CREATE DATABASE`, `CREATE TABLE`) and ingestion (`INSERT INTO <table> (<cols>) VALUES ...` or `FORMAT JSONEachRow`) statements on the local fallback engine.

func (*Engine) Query

func (e *Engine) Query(ctx context.Context, sql string, params map[string]tracedb.Param) (*tracedb.Result, error)

Query validates sql against tracedb.ValidateQuery, binds any {name:Type} parameters, and executes supported read-only queries with strict fail-closed semantics, returning tracedb.ErrUnsupportedLocalSQL on any unsupported ClickHouse SQL construct.

func (*Engine) Tables

func (e *Engine) Tables(db string) []tracedb.TableInfo

Tables returns schema metadata for all tables in db.

Jump to

Keyboard shortcuts

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