duckdb

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 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 Client

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

Client wraps a DuckDB database connection.

func NewClient

func NewClient(path string) (*Client, error)

NewClient opens (or creates) a DuckDB database file. path can be ":memory:" for in-memory or a file path for persistent storage.

func (*Client) Close

func (c *Client) Close() error

Close closes the underlying database connection.

func (*Client) DB

func (c *Client) DB() *sql.DB

DB exposes the underlying *sql.DB for use by store implementations.

func (*Client) InitSchema

func (c *Client) InitSchema() error

InitSchema creates the spans table and indexes if they don't exist.

type RequestStore

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

RequestStore implements dataplane.RequestReader and dataplane.RequestWriter backed by DuckDB. Request entries are stored in the denormalized spans table.

func NewRequestStore

func NewRequestStore(c *Client) *RequestStore

NewRequestStore creates a RequestStore using the given Client's database.

func (*RequestStore) GetByID

func (s *RequestStore) GetByID(ctx context.Context, id string) (*dataplane.RequestEntry, error)

GetByID returns a single request entry by span_id.

func (*RequestStore) Query

Query returns request entries matching the filter.

func (*RequestStore) Write

func (s *RequestStore) Write(ctx context.Context, entry dataplane.RequestEntry) error

Write inserts a single request entry as a span row.

type TraceStore

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

TraceStore implements dataplane.TraceReader and dataplane.TraceWriter backed by DuckDB.

func NewTraceStore

func NewTraceStore(c *Client) *TraceStore

NewTraceStore creates a TraceStore using the given Client's database.

func (*TraceStore) Get

func (s *TraceStore) Get(ctx context.Context, traceID string) (*dataplane.TraceContext, error)

Get retrieves all spans for a trace and assembles a parent/child tree.

func (*TraceStore) Search

Search returns TraceSummary entries matching the filter.

func (*TraceStore) Timeline

func (s *TraceStore) Timeline(ctx context.Context, traceID string) ([]dataplane.TimelineSpan, error)

Timeline returns a flat waterfall view of spans in a trace.

func (*TraceStore) WriteSpans

func (s *TraceStore) WriteSpans(ctx context.Context, spans []*dataplane.Span) error

WriteSpans inserts spans into the spans table.

Jump to

Keyboard shortcuts

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