Documentation
¶
Index ¶
- type Engine
- func (e *Engine) ClearTableCache()
- func (e *Engine) Close() error
- func (e *Engine) DescribeTable(ctx context.Context, tableName string) (*QueryResult, error)
- func (e *Engine) ExecuteQuery(ctx context.Context, query string) (*QueryResult, error)
- func (e *Engine) GetConfig() *EngineConfig
- func (e *Engine) GetMetrics() *EngineMetrics
- func (e *Engine) ListTables(ctx context.Context) ([]string, error)
- func (e *Engine) RegisterTable(ctx context.Context, identifier table.Identifier, icebergTable *table.Table) error
- type EngineConfig
- type EngineMetrics
- type QueryResult
- type SecurityError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine provides SQL query capabilities using DuckDB with native Iceberg support
func NewEngine ¶
func NewEngine(cat catalog.CatalogInterface) (*Engine, error)
NewEngine creates a new DuckDB engine instance with catalog-agnostic support
func NewEngineWithConfig ¶
func NewEngineWithConfig(cat catalog.CatalogInterface, config *EngineConfig) (*Engine, error)
NewEngineWithConfig creates a new DuckDB engine with custom configuration
func (*Engine) ClearTableCache ¶
func (e *Engine) ClearTableCache()
ClearTableCache clears any cached table information (no-op for this implementation)
func (*Engine) DescribeTable ¶
DescribeTable returns schema information for a table
func (*Engine) ExecuteQuery ¶
ExecuteQuery executes a SQL query and returns the results
func (*Engine) GetConfig ¶ added in v0.4.0
func (e *Engine) GetConfig() *EngineConfig
GetConfig returns the current engine configuration
func (*Engine) GetMetrics ¶
func (e *Engine) GetMetrics() *EngineMetrics
GetMetrics returns current engine performance metrics
func (*Engine) ListTables ¶
ListTables returns a list of all registered tables
func (*Engine) RegisterTable ¶
func (e *Engine) RegisterTable(ctx context.Context, identifier table.Identifier, icebergTable *table.Table) error
RegisterTable registers an Iceberg table for querying using DuckDB's native Iceberg support
type EngineConfig ¶
type EngineConfig struct {
MaxMemoryMB int
QueryTimeoutSec int
EnableQueryLog bool
EnableOptimization bool
CacheSize int
IcebergCatalogName string // Name for the attached Iceberg catalog in DuckDB
// Security settings
EnableQueryValidation bool // Enable SQL injection protection
AllowedStatements []string // Allowed SQL statement types (SELECT, SHOW, DESCRIBE, etc.)
BlockedKeywords []string // Blocked dangerous keywords
}
EngineConfig holds configuration options for the engine
func DefaultEngineConfig ¶
func DefaultEngineConfig() *EngineConfig
DefaultEngineConfig returns a default configuration for the engine
type EngineMetrics ¶
type EngineMetrics struct {
QueriesExecuted int64
TablesRegistered int64
CacheHits int64
CacheMisses int64
TotalQueryTime time.Duration
ErrorCount int64
BlockedQueries int64 // Track blocked malicious queries
// contains filtered or unexported fields
}
EngineMetrics tracks engine performance metrics
type QueryResult ¶
type QueryResult struct {
Columns []string
Rows [][]interface{}
Schema *arrow.Schema
Table arrow.Table
RowCount int64
Duration time.Duration
QueryID string
}
QueryResult represents the result of a SQL query
type SecurityError ¶ added in v0.5.0
SecurityError represents a security-related error
func (SecurityError) Error ¶ added in v0.5.0
func (e SecurityError) Error() string