Documentation
¶
Overview ¶
Package diagnostic provides shared types for schema parsing diagnostics.
This package exists to avoid import cycles between the main parser package and dialect-specific parser implementations (e.g., PostgreSQL parser).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
Diagnostic captures parser feedback for callers to display.
type IncrementalSchemaParser ¶ added in v0.11.0
type IncrementalSchemaParser interface {
SchemaParser
// ParseInto parses path/content and applies DDL mutations (CREATE, ALTER,
// DROP) directly into catalog. Diagnostics are returned and appended to any
// existing diagnostics in the catalog; the caller owns the slice.
ParseInto(ctx context.Context, path string, content []byte, catalog *model.Catalog) ([]Diagnostic, error)
}
IncrementalSchemaParser extends SchemaParser with incremental parsing: the caller supplies an existing catalog so that a later file can see tables created by earlier files (enabling cross-file ALTER / DROP resolution). Parsers that do not implement this interface fall back to the original Parse-then-merge behaviour.
type SchemaParser ¶
type SchemaParser interface {
Parse(ctx context.Context, path string, content []byte) (*model.Catalog, []Diagnostic, error)
}
SchemaParser parses SQL DDL statements and produces a schema catalog.