Help us shape the future of Go! Take the 2026 Go Developer Survey

sql

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package sql routes SQL source files to an explicitly selected dialect.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect interface {
	Name() string
	Extensions() []string
	Probe(context.Context, parserapi.Input) error
	Parse(context.Context, parserapi.Input) (graph.ParseResult, error)
}

Dialect is the extension point for a SQL grammar and graph extractor. Extensions returns dialect-specific extensions; the router always owns .sql.

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router is the sole top-level parser for SQL-like files. Dialects are sorted by name so probing and diagnostics never depend on registration order.

func New

func New(dialects ...Dialect) *Router

func (*Router) Language

func (*Router) Language() string

func (*Router) Parse

func (r *Router) Parse(ctx context.Context, input parserapi.Input) (graph.ParseResult, error)

func (*Router) SemanticDependencies

func (*Router) SemanticDependencies() []string

func (*Router) SemanticKey

func (*Router) SemanticKey(_ context.Context, input parserapi.Input) (string, error)

SemanticKey makes repository configuration part of the incremental file hash. Changing grafo.yaml therefore reparses unchanged SQL files that may be routed to a different dialect.

func (*Router) Supports

func (r *Router) Supports(filePath string) bool

Directories

Path Synopsis
Package sqlite parses SQLite SQL and extracts schema declarations and relation access.
Package sqlite parses SQLite SQL and extracts schema declarations and relation access.

Jump to

Keyboard shortcuts

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