engine

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 6 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
	Records   []arrow.Record
}

QueryResult holds the output of a SQL execution.

func BuildFromReader

func BuildFromReader(reader array.RecordReader, limit int) (*QueryResult, error)

BuildFromReader reads all record batches from a reader and builds the preview rows up to the given limit.

func (*QueryResult) Release

func (r *QueryResult) Release()

Release releases all Arrow records held by the result.

Jump to

Keyboard shortcuts

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