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 ¶
- type Engine
- func (e *Engine) Close() error
- func (e *Engine) Database() string
- func (e *Engine) Databases() []string
- func (e *Engine) EngineName() string
- func (e *Engine) Exec(ctx context.Context, sql string) error
- func (e *Engine) Query(ctx context.Context, sql string, params map[string]tracedb.Param) (*tracedb.Result, error)
- func (e *Engine) Tables(db string) []tracedb.TableInfo
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 ¶
New creates or opens a local fallback engine for tracedb.DefaultDatabase stored in <sessionDir>/tracedb/ (or purely in memory when sessionDir == "").
func Open ¶
Open creates or opens a local fallback engine for db stored in <sessionDir>/tracedb/ (or purely in memory when sessionDir == "").
func (*Engine) EngineName ¶
EngineName returns tracedb.EngineLocalFallback ("local_fallback").
func (*Engine) Exec ¶
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.