sdk

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultConfig

type DefaultConfig int

DefaultConfig represents pre-configured defaults

const (
	CIDefaults DefaultConfig = iota
	LocalDefaults
	FastDefaults
)

type TestBox

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

TestBox represents an ephemeral Icebox instance for testing

func NewTestBox

func NewTestBox(t *testing.T, opts ...TestBoxOption) *TestBox

NewTestBox creates a new ephemeral Icebox instance for testing This provides the "sdk.NewTestBox(t)" functionality mentioned in the design

func (*TestBox) CreateNamespace

func (tb *TestBox) CreateNamespace(name string, properties ...map[string]string) table.Identifier

CreateNamespace creates a test namespace

func (*TestBox) CreateTable

func (tb *TestBox) CreateTable(namespace, tableName string, schema ...*iceberg.Schema) *table.Table

CreateTable creates a test table with a simple schema

func (*TestBox) ExecuteSQL

func (tb *TestBox) ExecuteSQL(query string) (*duckdb.QueryResult, error)

ExecuteSQL executes a SQL query and returns results

func (*TestBox) GetCatalog

func (tb *TestBox) GetCatalog() *sqlite.Catalog

GetCatalog returns the test catalog

func (*TestBox) GetConfig

func (tb *TestBox) GetConfig() *config.Config

GetConfig returns the test configuration

func (*TestBox) GetEngine

func (tb *TestBox) GetEngine() *duckdb.Engine

GetEngine returns the test SQL engine

func (*TestBox) GetMemoryFS

func (tb *TestBox) GetMemoryFS() *memory.MemoryFileSystem

GetMemoryFS returns the memory filesystem if enabled

func (*TestBox) MustExecuteSQL

func (tb *TestBox) MustExecuteSQL(query string) *duckdb.QueryResult

MustExecuteSQL executes a SQL query and fails the test on error

func (*TestBox) RegisterTable

func (tb *TestBox) RegisterTable(icebergTable *table.Table)

RegisterTable registers a table with the SQL engine for querying

type TestBoxConfig

type TestBoxConfig struct {
	Name         string
	TempDir      string
	UseMemoryFS  bool
	MemoryLimit  string
	QueryTimeout string
	Properties   map[string]string
}

TestBoxConfig holds configuration for test instances

type TestBoxOption

type TestBoxOption func(*TestBoxConfig)

TestBoxOption configures a TestBox instance

func WithDefaults

func WithDefaults(defaults DefaultConfig) TestBoxOption

WithDefaults provides default configuration optimized for CI environments

func WithFileSystem

func WithFileSystem() TestBoxOption

WithFileSystem forces the use of filesystem storage instead of memory

func WithMemoryLimit

func WithMemoryLimit(limit string) TestBoxOption

WithMemoryLimit sets the DuckDB memory limit

func WithName

func WithName(name string) TestBoxOption

WithName sets the catalog name for the test instance

func WithProperty

func WithProperty(key, value string) TestBoxOption

WithProperty sets a configuration property

func WithTempDir

func WithTempDir(dir string) TestBoxOption

WithTempDir sets a custom temporary directory (only used with filesystem storage)

Jump to

Keyboard shortcuts

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