GSP .NET SDK

.NET SQL Parser SDK for C# and VB.NET

GSP is a commercial .NET SQL parser and semantic analysis SDK for teams that need reliable parsing, table and column extraction, offline validation, formatting, and column-level lineage across complex enterprise SQL dialects — all in-process, with no database connection.

Current release 4.1.0.6 (2026-07-15) · targets net10.0 and netstandard2.0

Short Answer

Use GSP .NET when your C# or VB.NET application needs more than syntax parsing: stable AST APIs exposed as idiomatic .NET properties, dialect-aware analysis, table and column extraction, offline SQL validation, a production SQL formatter, and column-level lineage that runs locally inside an enterprise environment.

Key takeaways

15 dedicated grammarsOracle, SQL Server, PostgreSQL, MySQL, DB2, Teradata, Snowflake, Redshift, Hive, Impala, and more — each a compile-time switch.
Idiomatic C# APIProperties, not Java getters: parser.Errormessage, stmt.ResultColumnList, table.FullName.
net10.0 + netstandard2.0One package serves .NET 10 and .NET Framework 4.6.1+ consumers. Builds and runs on Linux, macOS, and Windows.

3-minute quick start

Evaluate GSP .NET 4.1.0.6 locally

Every snippet below was compiled against GSP .NET 4.1.0.6 and executed — the outputs in the comments are the program's real output, not illustrations. If you cannot use a public package repository, request the trial package and restore it from a local folder.

1. Reference the package

<!-- your .csproj -->
<ItemGroup>
  <PackageReference Include="gudusoft.gsqlparser" Version="4.1.0.6" />
</ItemGroup>

The public nuget.org listing trails the current release; Gudu supplies 4.1.0.6 directly with your evaluation.

2. Parse one SQL statement

using gudusoft.gsqlparser;

string sql = @"select c.customer_id, sum(o.amount) total
               from customers c join orders o on c.id = o.customer_id
               group by c.customer_id";

TGSqlParser parser = new TGSqlParser(EDbVendor.dbvoracle);
parser.sqltext = sql;
int result = parser.parse();

3. Handle parser errors clearly

if (result != 0)
{
    Console.WriteLine(parser.Errormessage);
    // e.g. syntax error, state:90(10101) near: from(1,8)
    return;
}

Errors carry the offending token with line and column position, so you can point a user straight at the problem.

4. Inspect AST, tables, and columns

using gudusoft.gsqlparser.nodes;

for (int i = 0; i < parser.sqlstatements.size(); i++)
{
    TCustomSqlStatement stmt = parser.sqlstatements.get(i);
    Console.WriteLine(stmt.sqlstatementtype);            // sstselect

    for (int t = 0; t < stmt.tables.size(); t++)
    {
        TTable table = stmt.tables.getTable(t);
        Console.WriteLine(table.FullName + " " + table.AliasName);
        // customers c
        // orders o
    }

    for (int c = 0; c < stmt.ResultColumnList.size(); c++)
    {
        TResultColumn rc = stmt.ResultColumnList.getResultColumn(c);
        Console.WriteLine(rc.Expr + (rc.AliasClause != null ? " AS " + rc.AliasClause : ""));
        // c.customer_id
        // sum(o.amount) AS total
    }
}

Example outputs

What your .NET product can build on

ASTStatement type, clauses, expressions, joins, predicates, functions, and nested query structure.
Tables and columnsSource tables, result columns, aliases, scopes, and references for downstream tooling.
ValidationParser and semantic error signals for invalid SQL, unsupported syntax, or catalog-aware checks.
LineageTable and column dependency signals for impact analysis and governance workflows.

Built in

Format SQL from the same parse tree

The formatter is part of the library, not a separate product — it renders the AST you already parsed, so it never reflows SQL it did not understand.

C#

using gudusoft.gsqlparser.pp.para;
using gudusoft.gsqlparser.pp.stmtformatter;

TGSqlParser parser = new TGSqlParser(EDbVendor.dbvmssql);
parser.sqltext = "select a.id,b.name from t1 a inner join t2 b on a.id=b.id "
               + "where a.status='X' order by 1";
if (parser.parse() != 0) { Console.Error.WriteLine(parser.Errormessage); return; }

GFmtOpt option = GFmtOptFactory.newInstance();
Console.WriteLine(FormatterFactory.pp(parser, option));

Output

SELECT   a.id,
         b.NAME
FROM     t1 a
         INNER JOIN t2 b
         ON a.id = b.id
WHERE    a.status = 'X'
ORDER BY 1

Column-level lineage

Trace a column back through views and aggregates

The dataFlowAnalyzer demo ships as C# source with the SDK. Below is its real output for a CREATE VIEW over a two-table join with a SUM() — note that TOTAL_AMOUNT is resolved to ORDERS.AMOUNT through the aggregate, and the join keys are recorded separately as a dataflow_recordset relation.

<dlineage>
  <table id="1" name="CUSTOMERS" type="table" alias="C">
    <column id="2" name="CUSTOMER_ID" />
    <column id="1" name="ID" />
  </table>
  <table id="2" name="ORDERS" type="table" alias="O">
    <column id="5" name="AMOUNT" />
  </table>
  <view id="4" name="V_CUSTOMER_TOTAL" type="view">
    <column id="9" name="TOTAL_AMOUNT" />
  </view>
  <relation type="dataflow" id="2">
    <target id="7" column="TOTAL_AMOUNT" parent_name="RESULT_OF_SELECT-QUERY" />
    <source id="5" column="AMOUNT"       parent_name="ORDERS" />
  </relation>
  <relation type="dataflow_recordset" id="5">
    <target id="7" column="TOTAL_AMOUNT" parent_name="RESULT_OF_SELECT-QUERY" function="SUM" />
    <source id="1" column="ID"           parent_name="CUSTOMERS" />
  </relation>
</dlineage>

Same engine behind Gudu SQLFlow and the lineage integrations for DataHub and OpenMetadata.

Runtime support

One package, old and new .NET

net10.0.NET 10 (LTS) — the recommended target for new C# and VB.NET projects.
netstandard2.0.NET Framework 4.6.1+, and any other .NET Standard 2.0 consumer. Nothing to recompile for legacy WinForms/WPF/ASP.NET hosts.

Looking for the JVM instead? See the Java SQL Parser SDK. The two editions share the same grammar lineage and AST model, with .NET exposing it through properties.

FAQ

Questions .NET evaluators actually ask

Does the .NET edition use Java-style getters?

No. GSP .NET exposes idiomatic C# properties: parser.Errormessage, stmt.ResultColumnList, table.FullName, table.AliasName. If you are porting code or examples written against the Java edition, getFromClause() becomes .FromClause and getAliasName() becomes .AliasName — the Java method forms do not exist in the .NET assembly.

Which SQL dialects does the .NET edition support?

15 dedicated grammars: Oracle, SQL Server (T-SQL), MySQL, PostgreSQL, DB2, Teradata, Snowflake, Redshift, Hive, Impala, Netezza, Greenplum, Informix, Sybase ASE, MDX. ANSI, generic, ODBC, Access, and Firebird are handled by the shared core grammar. BigQuery, SAP HANA, and DAX are available in the Java edition only — constructing a .NET parser for those vendors throws NotSupportedException rather than silently mis-parsing.

Can I ship a build with only the databases I license?

Yes. Each dialect is a compile-time switch (/p:includeOracle=true, /p:includeMssql=true, and so on), so a per-customer build carries only the grammar tables you paid for and nothing else. This keeps the shipped assembly small and the licensed surface explicit.

Does validating SQL require a database connection?

No. Parsing, validation, formatting, and lineage all run entirely in-process with no server, driver, or credentials. This is what makes GSP usable inside air-gapped and regulated environments.

Is the .NET edition on nuget.org?

The public nuget.org listing for gudusoft.gsqlparser trails the current release. GSP .NET 4.1.0.6 (released 2026-07-15) is supplied directly by Gudu with your evaluation or licence, so you can restore it from an internal feed or a local package folder.

Trial path

Start with your own SQL, not a perfect demo

If you already have a corpus, stored procedures, migration scripts, or AI-generated queries, send a representative sample first. Gudu can recommend the right API path and evaluation setup.