Documentation
¶
Overview ¶
Package result provides result types for AQL query execution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExcelFormatter ¶
type ExcelFormatter struct {
// contains filtered or unexported fields
}
ExcelFormatter formats query results as Excel files.
func NewExcelFormatter ¶
func NewExcelFormatter() *ExcelFormatter
NewExcelFormatter creates a new Excel formatter.
func (*ExcelFormatter) FormatMultiSheet ¶
func (f *ExcelFormatter) FormatMultiSheet(path string, sheets map[string]*Result) error
FormatMultiSheet writes multiple results to an Excel file with multiple sheets.
func (*ExcelFormatter) FormatToFile ¶
func (f *ExcelFormatter) FormatToFile(path string, result *Result) error
FormatToFile writes the result to an Excel file.
func (*ExcelFormatter) WithFields ¶
func (f *ExcelFormatter) WithFields(fields []string) *ExcelFormatter
WithFields sets specific fields to output.
type ExecutionStats ¶
type ExecutionStats struct {
// ExecutionTime is the total execution time.
ExecutionTime int64 // milliseconds
// APICallCount is the number of API calls made.
APICallCount int
// RecordsFetched is the total number of records fetched from API.
RecordsFetched int
// RecordsReturned is the number of records in the final result.
RecordsReturned int
// CacheHit indicates if the result was served from cache.
CacheHit bool
// FiltersPushed is the number of filters pushed to the API.
FiltersPushed int
// ClientFilters is the number of filters applied client-side.
ClientFilters int
}
ExecutionStats contains query execution statistics.
type Format ¶
type Format string
Format represents an output format.
const ( FormatTable Format = "table" FormatJSON Format = "json" FormatCSV Format = "csv" FormatMarkdown Format = "markdown" FormatYAML Format = "yaml" FormatHTML Format = "html" FormatExcel Format = "xlsx" )
Output formats.
func (Format) IsFileFormat ¶
IsFileFormat returns true if the format requires writing to a file.
type Formatter ¶
type Formatter struct {
// contains filtered or unexported fields
}
Formatter formats query results for output.
func NewFormatter ¶
NewFormatter creates a new formatter with the given format.
func (*Formatter) WithFields ¶
WithFields sets specific fields to output.
type Metadata ¶
type Metadata struct {
// TotalCount is the total number of matching records (before LIMIT).
TotalCount int
// ExecutionTimeMs is the query execution time in milliseconds.
ExecutionTimeMs int64
// IsTruncated indicates if results were truncated due to LIMIT.
IsTruncated bool
}
Metadata contains optional result metadata.
type Record ¶
Record represents a single result row as a map of field names to values.
func (Record) CustomFieldKeys ¶
CustomFieldKeys returns all custom field keys (without the "custom." prefix).
func (Record) Get ¶
Get returns the value for a field, or nil if not found. Supports custom field lookup using "custom.fieldname" syntax.
func (Record) GetString ¶
GetString returns the string value for a field, or empty string if not found.
func (Record) HasCustomFields ¶
HasCustomFields returns true if the record has any custom fields.
func (Record) SetCustomField ¶
SetCustomField sets a custom field value using the "custom.key" format.
type Result ¶
type Result struct {
// Entity is the entity type that was queried.
Entity ast.EntityType
// Records contains the query results.
Records []Record
// Metadata contains optional result metadata.
Metadata Metadata
// Stats contains execution statistics (optional).
Stats *ExecutionStats
}
Result represents the result of an AQL query execution.