Documentation
¶
Index ¶
- type DefaultConfig
- type TestBox
- func (tb *TestBox) CreateNamespace(name string, properties ...map[string]string) table.Identifier
- func (tb *TestBox) CreateTable(namespace, tableName string, schema ...*iceberg.Schema) *table.Table
- func (tb *TestBox) ExecuteSQL(query string) (*duckdb.QueryResult, error)
- func (tb *TestBox) GetCatalog() *sqlite.Catalog
- func (tb *TestBox) GetConfig() *config.Config
- func (tb *TestBox) GetEngine() *duckdb.Engine
- func (tb *TestBox) GetMemoryFS() *memory.MemoryFileSystem
- func (tb *TestBox) MustExecuteSQL(query string) *duckdb.QueryResult
- func (tb *TestBox) RegisterTable(icebergTable *table.Table)
- type TestBoxConfig
- type TestBoxOption
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 ¶
CreateNamespace creates a test namespace
func (*TestBox) CreateTable ¶
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 ¶
GetCatalog returns the test catalog
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 ¶
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)