Documentation
¶
Overview ¶
Package parser implements a DDL parser for SQLite schemas.
Index ¶
Constants ¶
const ( SeverityError = diagnostic.SeverityError SeverityWarning = diagnostic.SeverityWarning )
Severity constants for backward compatibility.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostic ¶
type Diagnostic = diagnostic.Diagnostic
Diagnostic is an alias for backward compatibility.
func ParseWithCatalog ¶ added in v0.11.0
func ParseWithCatalog(path string, tokens []tokenizer.Token, catalog *model.Catalog) (*model.Catalog, []Diagnostic, error)
ParseWithCatalog constructs a catalog by parsing tokens and applying DDL mutations into catalog. It is the incremental variant of Parse: by seeding catalog with tables from previously-parsed files, ALTER/DROP statements in the current file can resolve tables from earlier files. The caller owns catalog; after the call it is mutated in place and also returned.
type IncrementalSchemaParser ¶ added in v0.11.0
type IncrementalSchemaParser = diagnostic.IncrementalSchemaParser
IncrementalSchemaParser is an alias exposing the incremental-parse interface.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser consumes tokenizer output and produces a normalized catalog.
type SchemaParser ¶
type SchemaParser = diagnostic.SchemaParser
SchemaParser is an alias for backward compatibility.
func NewSchemaParser ¶
func NewSchemaParser(dialect string) (SchemaParser, error)
NewSchemaParser creates a new SchemaParser for the specified dialect. "sqlite" and "turso" are supported (Turso parses SQLite-compatible DDL). For PostgreSQL, use the postgres package directly.
type Severity ¶
type Severity = diagnostic.Severity
Severity is an alias for backward compatibility.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package clickhouse provides a ClickHouse DDL parser.
|
Package clickhouse provides a ClickHouse DDL parser. |
|
Package mysql provides SQL keyword constants for the MySQL parser.
|
Package mysql provides SQL keyword constants for the MySQL parser. |
|
Package postgres provides SQL keyword constants for the PostgreSQL parser.
|
Package postgres provides SQL keyword constants for the PostgreSQL parser. |