engine

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColumnMeta

type ColumnMeta struct {
	Name string
	Type string
}

ColumnMeta holds metadata for a single result column.

type Engine

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

Engine executes SQL queries via DuckDB and returns Arrow results.

func NewEngine

func NewEngine(connector *duckdb.Connector) *Engine

NewEngine creates a new execution engine from a DuckDB connector.

func (*Engine) Close

func (e *Engine) Close() error

Close closes the engine (no-op, connector is managed externally).

func (*Engine) Execute

func (e *Engine) Execute(ctx context.Context, query string) (array.RecordReader, error)

Execute runs a SQL query and returns an Arrow RecordReader. The caller must call Release() on the returned reader, which also closes the underlying DuckDB connection.

type QueryResult

type QueryResult struct {
	QueryID   string
	Columns   []ColumnMeta
	Rows      [][]string
	TotalRows int64
	NumChunks int
}

QueryResult holds the output of a SQL execution.

func BuildPreviewFromReader added in v0.1.1

func BuildPreviewFromReader(
	reader array.RecordReader,
	previewLimit int,
	onBatch func(rec arrow.Record) error,
) (*QueryResult, error)

BuildPreviewFromReader reads record batches, builds preview rows, and streams each batch to the provided callback without accumulating all records in memory.

Jump to

Keyboard shortcuts

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