session

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager manages shared sessions, keyed by session ID.

func NewManager

func NewManager(connector *duckdb.Connector) *Manager

NewManager creates a new session manager.

func (*Manager) Close

func (m *Manager) Close()

Close closes all managed sessions.

func (*Manager) GetOrCreate

func (m *Manager) GetOrCreate(sessionID string) *Session

GetOrCreate returns an existing session or creates a new one.

type Session

type Session struct {
	ID           string
	Engine       *engine.Engine
	PreviewLimit int
	// contains filtered or unexported fields
}

Session represents a DuckDB execution context.

func NewSession

func NewSession(id string, connector *duckdb.Connector) *Session

NewSession creates a new session with the given connector.

func (*Session) Close

func (s *Session) Close() error

Close closes the session's engine.

func (*Session) Execute

func (s *Session) Execute(ctx context.Context, query string, sw *spool.StreamWriter) (*engine.QueryResult, error)

Execute runs a SQL query, streaming Arrow batches through a pipeline:

DuckDB RecordReader → Flatten → GeoArrow → Preview + Spool Write

Flatten expands nested Struct/List/Map/Union to top-level columns. GeoArrow converts WKB binary geometry columns to native GeoArrow format. Records are NOT accumulated in memory.

func (*Session) ExecutionCount

func (s *Session) ExecutionCount() int

ExecutionCount returns the current execution counter value.

func (*Session) NextExecutionCount added in v0.1.2

func (s *Session) NextExecutionCount() int

NextExecutionCount atomically increments and returns the new execution counter. Must be called once per execute request, before any messages are sent.

func (*Session) SetPreviewLimit

func (s *Session) SetPreviewLimit(limit int)

SetPreviewLimit updates the preview row limit.

Jump to

Keyboard shortcuts

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