dataql

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is set by the main package during initialization

Functions

func ApplyQueryParams added in v1.0.1

func ApplyQueryParams(query string, params map[string]string) string

ApplyQueryParams replaces :param placeholders in query with actual values Supports both :param and $param syntax

func GetAliasMap added in v1.0.1

func GetAliasMap(inputs []FileInput) map[string]string

GetAliasMap creates a map of path -> alias for non-empty aliases

func GetPaths added in v1.0.1

func GetPaths(inputs []FileInput) []string

GetPaths extracts just the paths from file inputs

func ParseQueryParams added in v1.0.1

func ParseQueryParams(params []string) (map[string]string, error)

ParseQueryParams parses query parameters from "name=value" format Returns a map of parameter names to values

Types

type DataQL

type DataQL interface {
	Run() error
	RunStorageOnly() error
	RunAndDescribe() error
	DescribeAll() error
	Close() error
}

DataQL is the main interface for the data query engine

func New

func New(params Params) (DataQL, error)

New creates a new DataQL instance

func NewStorageOnly added in v1.0.1

func NewStorageOnly(params Params) (DataQL, error)

NewStorageOnly creates a DataQL instance that only uses an existing DuckDB storage file This mode allows querying previously saved data without specifying input files

type FileInput added in v1.0.1

type FileInput struct {
	Path  string // File path
	Alias string // Optional table alias (empty if not specified)
}

FileInput represents a file path with an optional table alias

func ParseFileInput added in v1.0.1

func ParseFileInput(input string) FileInput

ParseFileInput parses a file input string that may contain an alias Format: "path" or "path:alias" Examples:

  • "data.csv" -> FileInput{Path: "data.csv", Alias: ""}
  • "data.csv:users" -> FileInput{Path: "data.csv", Alias: "users"}
  • "/path/to/file.csv:my_table" -> FileInput{Path: "/path/to/file.csv", Alias: "my_table"}

func ParseFileInputs added in v1.0.1

func ParseFileInputs(inputs []string) []FileInput

ParseFileInputs parses multiple file input strings

type ParamError added in v1.0.1

type ParamError struct {
	Param   string
	Message string
}

ParamError represents an error parsing a query parameter

func (*ParamError) Error added in v1.0.1

func (e *ParamError) Error() string

type Params

type Params struct {
	FileInputs     []string
	DataSourceName string
	Delimiter      string
	Query          string
	Export         string
	Type           string
	Lines          int
	Collection     string
	Verbose        bool
	Quiet          bool     // Suppress progress bar output
	NoSchema       bool     // Suppress table schema display before query results
	InputFormat    string   // Input format for stdin (csv, json, jsonl, xml, yaml)
	Truncate       int      // Truncate column values longer than N characters (0 = no truncation)
	Vertical       bool     // Display results in vertical format (like MySQL \G)
	QueryParams    []string // Query parameters in format "name=value"
	Cache          bool     // Enable data caching for faster subsequent queries
	CacheDir       string   // Cache directory path (default: ~/.dataql/cache)
}

Jump to

Keyboard shortcuts

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