Package io.github.fupacat
Class TSqlParser
java.lang.Object
io.github.fupacat.TSqlParser
High-level entry point and facade for parsing Transact-SQL (T-SQL) into strongly-typed
Abstract Syntax Trees (ASTs).
Example usage:
ParseResult<TSqlScript> result = TSqlParser.parse("SELECT 1 AS col FROM dbo.tbl;");
if (result.isSuccess()) {
TSqlScript script = result.fragment();
script.accept(new MyCustomVisitor());
} else {
result.errors().forEach(err -> System.err.println(err.message));
}
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTSqlParser(boolean initialQuotedIdentifiersOn, SqlVersion targetVersion) TSqlParser(SqlVersion targetVersion) -
Method Summary
Modifier and TypeMethodDescriptionstatic TSqlParser.Builderbuilder()booleanstatic voidStandalone CLI entry point for command-line syntax verification.static ParseResult<TSqlScript>Parses T-SQL from aReaderusing the default SQL Server 2025 (SQL180) superset engine.static ParseResult<TSqlScript>parse(Reader reader, SqlVersion version) Parses T-SQL from aReaderand validates compatibility against the specifiedSqlVersion.static ParseResult<TSqlScript>Parses a T-SQL string using the default SQL Server 2025 (SQL180) superset engine.static ParseResult<TSqlScript>parse(String sql, SqlVersion version) Parses a T-SQL string and validates compatibility against the specifiedSqlVersion.parseScript(Reader reader) Instance parse method for reading a full T-SQL script from aReader.parseScript(String sql) Instance parse method for reading a full T-SQL script from aString.
-
Constructor Details
-
TSqlParser
public TSqlParser() -
TSqlParser
-
TSqlParser
-
-
Method Details
-
parse
Parses a T-SQL string using the default SQL Server 2025 (SQL180) superset engine. -
parse
Parses a T-SQL string and validates compatibility against the specifiedSqlVersion. -
parse
Parses T-SQL from aReaderusing the default SQL Server 2025 (SQL180) superset engine. -
parse
Parses T-SQL from aReaderand validates compatibility against the specifiedSqlVersion. -
parseScript
Instance parse method for reading a full T-SQL script from aReader. -
parseScript
Instance parse method for reading a full T-SQL script from aString. -
isInitialQuotedIdentifiersOn
public boolean isInitialQuotedIdentifiersOn() -
getTargetVersion
-
builder
-
main
Standalone CLI entry point for command-line syntax verification.
-