compiler

package
v0.0.0-...-65fd79d Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package compiler provides compiler implementations for compiling an (*ast.SQLStmt) into a (command.Command), which then can be executed by an (executor.Executor).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler interface {
	// Compile compiles an SQLStmt to a command, which can be used by an
	// executor. If an error occurs during the compiling, it will be returned.
	// If such an error is not fatal to the compile process and there occur more
	// errors, the returned error will contain all occurred errors until a fatal
	// error.
	Compile(*ast.SQLStmt) (command.Command, error)
}

Compiler describes a component that is able to convert an (*ast.SQLStmt) to a (command.Command).

func New

func New(opts ...Option) Compiler

New creates a new, ready to use compiler with the given options applied.

type Error

type Error string

Error is a helper type for creating constant errors.

const (
	// ErrUnsupported indicates that something is not supported. What exactly is
	// unsupported, must be indicated by a wrapping error.
	ErrUnsupported Error = "unsupported"
)

func (Error) Error

func (e Error) Error() string

type Option

type Option func(*simpleCompiler)

Option is a functional option that can be applied to a compiler. If the option is applicable to the compiler, is determined by the compiler itself.

Directories

Path Synopsis
Package command defines a command model, known as the intermediary representation.
Package command defines a command model, known as the intermediary representation.
Package optimization provides command optimizations that are used by the compiler.
Package optimization provides command optimizations that are used by the compiler.

Jump to

Keyboard shortcuts

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