Skip to content

nycdotnet/TSqlFlex.SqlParser

Repository files navigation

TSqlFlex.SqlParser

This is a simple T-SQL parser written in C#.

As of right now, only the tokenizer works and only for the most elementary of SQL statements. Block comments, line comments, and strings including escaped ' characters should be working.

Currently, the best way to see how it works is to examine the tests.

example:

var tokenizerTask = SqlTokenizer.TokenizeAsync("SELECT * FROM MyTable");
var sqlTokens = await tokenizerTask;
for (int i = 0; i < sqlTokens.Count; i += 1)
{
    Debug.Print(sqlTokens[i].TokenType.ToString());
}
/*
    Outputs:
    Select
    Whitespace
    Star
    Whitespace
    From
    Whitespace
    Unknown
*/

About

Simple T-SQL Parser

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages