sql

package
v0.0.4-beta.12 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sql implements a lightweight regex-based parser for SQL files. Extracts CREATE TABLE/VIEW/INDEX/FUNCTION/PROCEDURE/TRIGGER statements without any tree-sitter dependency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependency

type Dependency struct {
	Path       string
	Type       string // "reference"
	LineNumber int
}

Dependency represents a table/view reference.

type Entity

type Entity struct {
	Name      string
	Type      string // "table", "view", "index", "function", "procedure", "trigger", "schema", "type"
	Kind      string
	Signature string
	StartLine int
	EndLine   int
}

Entity represents a named SQL object.

type ParseResult

type ParseResult struct {
	FilePath     string
	Entities     []*Entity
	Dependencies []*Dependency
}

ParseResult is the output of Parse.

func Parse

func Parse(filePath string, content string) *ParseResult

Parse parses a SQL file using regex-based extraction.

Jump to

Keyboard shortcuts

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