sqlscan

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SkipTrivia

func SkipTrivia(s string, i int) int

SkipTrivia advances past whitespace and SQL comments starting at i.

func StatementEnd

func StatementEnd(s string, start int) int

StatementEnd returns the index just past the terminating semicolon of the statement beginning at start, honoring string literals, dollar quoted bodies, and comments so semicolons inside them never split a statement.

func Statements

func Statements(content string) []string

Statements splits content into top level statement bodies, each trimmed of its leading trivia. Trailing trivia after the final statement is dropped.

Types

type Object

type Object struct {
	Kind  string
	Name  string
	Line  int
	SQL   string
	Stats []Stat
}

func Scan

func Scan(content string) []Object

Scan returns one Object per recognized top level statement, each carrying a kind, qualified name, source line, and a set of statically derived stats.

type Stat

type Stat struct {
	Key string
	Val string
}

Jump to

Keyboard shortcuts

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