statement

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package statement segments preprocessed DQL into top-level SQL and Velty operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDMLServiceMethod

func IsDMLServiceMethod(name string) bool

IsDMLServiceMethod reports whether name belongs to the Velty DML capability.

Types

type Classification

type Classification struct {
	HasRead    bool
	HasExec    bool
	HasService bool
	HasUnknown bool
}

type Kind

type Kind string
const (
	KindUnknown Kind = "unknown"
	KindRead    Kind = "read"
	KindExec    Kind = "exec"
	KindService Kind = "service"
)

type Statement

type Statement struct {
	Start            int
	End              int
	SQLStart         int
	SQLEnd           int
	TemplateBalanced bool
	OperationStart   int
	Kind             Kind
	Operation        string
}

func (*Statement) IsExecutable

func (s *Statement) IsExecutable() bool

type Statements

type Statements []*Statement

func Parse

func Parse(sqlText string) Statements

Parse classifies explicitly delimited top-level statements in preprocessed DQL. Newlines remain SQL whitespace; only top-level semicolons delimit SQL. Offsets are relative to sqlText and map through transcribe.SourceMap.

func (Statements) Classify

func (s Statements) Classify() Classification

Jump to

Keyboard shortcuts

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