hugr

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 35 Imported by: 0

README

query-engine

The Hugr query engine

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParallelMutationNotSupported = errors.New("parallel mutation queries are not supported")

Functions

This section is empty.

Types

type Config

type Config struct {
	DB               db.Config
	AdminUI          bool
	AdminUIFetchPath string
	Debug            bool

	AllowParallel      bool
	MaxParallelQueries int
	MaxDepth           int

	CoreDB *coredb.Source
	Auth   *auth.Config
	Cache  cache.Config
}

type JQRequest

type JQRequest struct {
	JQ    string  `json:"jq"`
	Query Request `json:"query"`
}

type Request

type Request struct {
	Query         string                 `json:"query"`
	Variables     map[string]interface{} `json:"variables"`
	OperationName string                 `json:"operationName,omitempty"`
}

type Service

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

func New

func New(config Config) *Service

func (*Service) AttachRuntimeSource

func (s *Service) AttachRuntimeSource(ctx context.Context, source sources.RuntimeSource) error

func (*Service) Close

func (s *Service) Close() error

func (*Service) Commit

func (s *Service) Commit(ctx context.Context) error

func (*Service) ContextWithTx

func (s *Service) ContextWithTx(ctx context.Context) (context.Context, error)

func (*Service) Init

func (s *Service) Init(ctx context.Context) (err error)

func (*Service) ProcessQuery

func (s *Service) ProcessQuery(ctx context.Context, catalog string, req Request) types.Response

func (*Service) Query

func (s *Service) Query(ctx context.Context, query string, vars map[string]any) (*types.Response, error)

func (*Service) QueryCatalog

func (s *Service) QueryCatalog(ctx context.Context, catalog, query string, vars map[string]any) (*types.Response, error)

func (*Service) Rollback

func (s *Service) Rollback(ctx context.Context) error

func (*Service) Schema

func (s *Service) Schema() *ast.Schema

func (*Service) ServeHTTP

func (s *Service) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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