executor

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package executor executes AQL query plans against the Aha API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor executes query plans against the Aha API.

func New

func New(client *aha.Client) *Executor

New creates a new executor with the given Aha client.

func (*Executor) Execute

func (e *Executor) Execute(ctx context.Context, plan *planner.Plan) (*result.Result, error)

Execute executes a query plan and returns the results.

func (*Executor) ExecuteDelete

func (e *Executor) ExecuteDelete(ctx context.Context, stmt *ast.DeleteStatement, opts MutationOptions) (*MutationResult, error)

ExecuteDelete executes a DELETE statement.

func (*Executor) ExecuteInsert

func (e *Executor) ExecuteInsert(ctx context.Context, stmt *ast.InsertStatement, opts MutationOptions) (*MutationResult, error)

ExecuteInsert executes an INSERT statement.

func (*Executor) ExecuteUpdate

func (e *Executor) ExecuteUpdate(ctx context.Context, stmt *ast.UpdateStatement, opts MutationOptions) (*MutationResult, error)

ExecuteUpdate executes an UPDATE statement.

func (*Executor) WithProgress added in v0.9.0

func (e *Executor) WithProgress(fn ProgressFunc) *Executor

WithProgress sets a progress callback for the executor.

type MutationOptions

type MutationOptions struct {
	// DryRun if true, shows what would happen without making changes.
	DryRun bool

	// ProductID is required for most mutations.
	ProductID string

	// ReleaseID is required for creating features.
	ReleaseID string
}

MutationOptions configures mutation execution.

type MutationResult

type MutationResult struct {
	// Operation is the type of mutation (INSERT, UPDATE, DELETE).
	Operation string

	// Entity is the entity type affected.
	Entity ast.EntityType

	// AffectedCount is the number of records affected.
	AffectedCount int

	// Records contains the affected records (for INSERT/UPDATE).
	Records []result.Record

	// IDs contains the IDs of affected records.
	IDs []string

	// DryRun indicates if this was a dry run.
	DryRun bool

	// Errors contains any errors encountered during the operation.
	Errors []error
}

MutationResult represents the result of a mutation operation.

type ProgressFunc added in v0.9.0

type ProgressFunc func(current, total int, message string)

ProgressFunc is called during query execution to report progress. current is the current item count, total is the estimated total (0 if unknown), and message describes the current operation.

Jump to

Keyboard shortcuts

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