cockroachdb

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// SystemSchemaWhereClause is an optimization for getting less schema objects.
	SystemSchemaWhereClause = func() string {
		var schemas []string
		for schema := range systemSchemas {
			schemas = append(schemas, fmt.Sprintf("'%s'", schema))
		}
		return strings.Join(schemas, ",")
	}()
)

Functions

func IsSystemDatabase

func IsSystemDatabase(database string) bool

func IsSystemSchema

func IsSystemSchema(schema string) bool

func SplitSQLStatement

func SplitSQLStatement(statement string) ([]string, error)

Types

type AST

type AST struct {
	// StartPosition is the 1-based position where this statement starts.
	StartPosition *storepb.Position
	Stmt          statements.Statement[tree.Statement]
}

AST is the AST implementation for CockroachDB parser. It implements the base.AST interface.

func GetCockroachDBAST

func GetCockroachDBAST(a base.AST) (*AST, bool)

GetCockroachDBAST extracts the CockroachDB AST from a base.AST. Returns the AST and true if it is a CockroachDB AST, nil and false otherwise.

func (*AST) ASTStartPosition

func (a *AST) ASTStartPosition() *storepb.Position

ASTStartPosition implements base.AST interface.

type ParseResult

type ParseResult struct {
	Stmts statements.Statements
}

func ParseCockroachDBSQL

func ParseCockroachDBSQL(statement string) (*ParseResult, error)

ParseCockroachDBSQL parses the given CockroachDB statement by using LALR(1) parser. Returns the AST if no error.

Jump to

Keyboard shortcuts

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