execution

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Query executes a read query and scans results into dest
	Query(ctx context.Context, dest any) error
	// QueryWithTypes handles interface types that need type discrimination
	QueryWithTypes(ctx context.Context, dest any, types map[string]reflect.Type, typeKey string) error
	// Mutate executes a create/update/delete mutation and scans results into dest
	Mutate(ctx context.Context, dest any) error
}

Executor is the main interface for executing GraphQL operations against any database. Each database implementation (PostgreSQL, MongoDB, etc.) implements this interface.

type MultiExecutor added in v0.3.1

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

MultiExecutor routes queries to the appropriate executor based on the type's dialect. It reads the dialect from the @table directive on each GraphQL type.

func NewMultiExecutor added in v0.3.1

func NewMultiExecutor(schema *ast.Schema, defaultDialect string) *MultiExecutor

NewMultiExecutor creates a new MultiExecutor with the given schema and default dialect.

func (*MultiExecutor) Mutate added in v0.3.1

func (m *MultiExecutor) Mutate(ctx context.Context, dest any) error

Mutate routes the mutation to the appropriate executor based on the type's dialect.

func (*MultiExecutor) Query added in v0.3.1

func (m *MultiExecutor) Query(ctx context.Context, dest any) error

Query routes the query to the appropriate executor based on the type's dialect.

func (*MultiExecutor) QueryWithTypes added in v0.3.1

func (m *MultiExecutor) QueryWithTypes(ctx context.Context, dest any, types map[string]reflect.Type, typeKey string) error

QueryWithTypes routes the query to the appropriate executor for interface types.

func (*MultiExecutor) Register added in v0.3.1

func (m *MultiExecutor) Register(dialect string, executor Executor)

Register adds an executor for a specific dialect.

Directories

Path Synopsis
sql

Jump to

Keyboard shortcuts

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