decl

package
v0.39.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ScanCalls

func ScanCalls(input string, options CallScanOptions) ([]Call, []CallParseError)

ScanCalls parses function calls and returns parsed calls plus malformed-call errors.

Types

type Call

type Call struct {
	Name      string
	Args      []string
	Offset    int
	EndOffset int
	Dollar    bool
}

Call represents a parsed function call with offsets in the scanned input.

type CallParseError

type CallParseError struct {
	Name    string
	Offset  int
	Message string
}

CallParseError represents a malformed call span.

type CallScanOptions

type CallScanOptions struct {
	AllowedNames  map[string]bool
	RequireDollar bool
	AllowDollar   bool
	Strict        bool
}

CallScanOptions controls call scanning behavior.

type Declaration

type Declaration struct {
	Kind   Kind
	Raw    string
	Offset int
	Args   []string

	// Normalized fields for known declarations.
	Target    string // first argument (alias/column)
	DataType  string // cast(... as type)
	Tag       string // tag(..., "...") payload
	Limit     string // set_limit(..., N)
	Connector string // use_connector(view, connector)
	Strategy  string // match_strategy(view, strategy)
	Partition string // set_partitioner(view, partitioner, concurrency)
	Size      string // compress_above_size(size)
	Value     string // generic second argument (batch_size, relational_concurrency, cardinality)
	Package   string // package(default/package)
	Alias     string // import(alias, package/path)
}

Declaration represents one parsed function declaration in DQL.

func Parse

func Parse(dql string) ([]*Declaration, error)

Parse extracts declarations from original DQL text.

func (*Declaration) String

func (d *Declaration) String() string

type Kind

type Kind string

Kind identifies parsed declaration function.

const (
	KindCast                  Kind = "cast"
	KindTag                   Kind = "tag"
	KindSetLimit              Kind = "set_limit"
	KindAllowNulls            Kind = "allow_nulls"
	KindSetPartitioner        Kind = "set_partitioner"
	KindUseConnector          Kind = "use_connector"
	KindMatchStrategy         Kind = "match_strategy"
	KindCompressAboveSize     Kind = "compress_above_size"
	KindBatchSize             Kind = "batch_size"
	KindRelationalConcurrency Kind = "relational_concurrency"
	KindPublishParent         Kind = "publish_parent"
	KindCardinality           Kind = "cardinality"
	KindPackage               Kind = "package"
	KindImport                Kind = "import"
)

Jump to

Keyboard shortcuts

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