server

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package server provides a production-grade DuckDB-backed Arrow Flight SQL server.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyQuery = status.Error(codes.InvalidArgument, "empty query provided")
	ErrNotFound   = status.Error(codes.NotFound, "statement handle not found or expired")
	ErrInternal   = status.Error(codes.Internal, "internal server error")
	ErrCancelled  = status.Error(codes.Canceled, "execution cancelled by client")
	ErrInvalidSQL = status.Error(codes.InvalidArgument, "invalid SQL statement")
)
View Source
var NewBatchGuard = engine.NewBatchGuard

NewBatchGuard is an alias for the engine's NewBatchGuard for backward compatibility.

Functions

This section is empty.

Types

type BatchGuard added in v0.15.0

type BatchGuard = engine.BatchGuard

BatchGuard is an alias for the engine's BatchGuard for backward compatibility.

type Config added in v0.13.0

type Config struct {
	DBPath               string
	HandleTTL            time.Duration
	GCInterval           time.Duration
	SchemaProbeTimeout   time.Duration
	MaxConcurrentQueries int
	ReadOnly             bool
	Logger               *slog.Logger
	DevMode              bool
	Engine               Engine
	Telemetry            telemetry.Publisher
}

type Engine added in v0.18.0

type Engine = engine.Engine

type Server

type Server struct {
	fsql.BaseServer

	Engine Engine

	Alloc  memory.Allocator
	Logger *slog.Logger

	Telemetry telemetry.Publisher
	// contains filtered or unexported fields
}

func NewServer

func NewServer(cfg Config) (*Server, error)

func (*Server) AsFlightServer

func (s *Server) AsFlightServer() flight.FlightServer

func (*Server) Close

func (s *Server) Close() error

func (*Server) ClosePreparedStatement

func (s *Server) ClosePreparedStatement(
	_ context.Context,
	req fsql.ActionClosePreparedStatementRequest,
) error

func (*Server) DoExchange

func (s *Server) DoExchange(
	ctx context.Context,
	stream flight.FlightService_DoExchangeServer,
) error

DoExchange operates outside the BaseServer routing and allows us to bypass channels entirely for true, zero-copy, synchronous streaming.

func (*Server) DoGetPreparedStatement

func (s *Server) DoGetPreparedStatement(
	ctx context.Context,
	cmd fsql.PreparedStatementQuery,
) (*arrow.Schema, <-chan flight.StreamChunk, error)

func (*Server) DoGetStatement

func (s *Server) DoGetStatement(
	ctx context.Context,
	ticket fsql.StatementQueryTicket,
) (*arrow.Schema, <-chan flight.StreamChunk, error)

func (*Server) DoPutCommandStatementIngest added in v0.21.0

func (s *Server) DoPutCommandStatementIngest(
	ctx context.Context,
	cmd fsql.StatementIngest,
	reader flight.MessageReader,
) (int64, error)

func (*Server) DoPutCommandStatementUpdate

func (s *Server) DoPutCommandStatementUpdate(
	ctx context.Context,
	cmd fsql.StatementUpdate,
) (int64, error)

func (*Server) DoPutPreparedStatementQuery

func (s *Server) DoPutPreparedStatementQuery(
	_ context.Context,
	cmd fsql.PreparedStatementQuery,
	reader flight.MessageReader,
	_ flight.MetadataWriter,
) ([]byte, error)

func (*Server) GetFlightInfoPreparedStatement

func (s *Server) GetFlightInfoPreparedStatement(
	ctx context.Context,
	cmd fsql.PreparedStatementQuery,
	desc *flight.FlightDescriptor,
) (*flight.FlightInfo, error)

func (*Server) GetFlightInfoStatement

func (s *Server) GetFlightInfoStatement(
	ctx context.Context,
	cmd fsql.StatementQuery,
	desc *flight.FlightDescriptor,
) (*flight.FlightInfo, error)

func (*Server) GetSchemaPreparedStatement

func (s *Server) GetSchemaPreparedStatement(
	ctx context.Context,
	cmd fsql.PreparedStatementQuery,
	_ *flight.FlightDescriptor,
) (*flight.SchemaResult, error)

func (*Server) GetSchemaStatement

func (s *Server) GetSchemaStatement(
	ctx context.Context,
	cmd fsql.StatementQuery,
	_ *flight.FlightDescriptor,
) (*flight.SchemaResult, error)

func (*Server) Shutdown added in v0.15.0

func (s *Server) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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