Member Junction
    Preparing search index...

    A SQL text in one dialect, parsed into statements by MJ's tolerant structural parser.

    • Lossless: every node covers a range of whole tokens; Text returns its slice of the input, and Print returns the input byte for byte.
    • Tolerant: parsing never throws. Syntax the parser does not know becomes an Unknown node plus a diagnostic, and the rest of the tree is still read.
    • Expressions are token ranges (SqlExpression) with helpers for identifier paths, function calls and stars; nested (SELECT …) are parsed as child queries.
    • Analyses are methods, computed on first call and kept. Each returns an Analysis: Complete is false whenever an Unknown node or a parse diagnostic could affect the answer.

    Template tags are not part of SQL: render the template first. A tag in the text is read as an opaque value and reported with a diagnostic.

    const doc = SqlDocument.Parse(sql, new SQLServerDialect());
    if (!doc.IsReadOnly().Value.IsReadOnly) refuse();
    const tables = doc.TableReferences().Value.filter(t => t.Kind === 'Table');
    Index

    Accessors

    Methods