using SqlParser;
using SqlParser.Dialects;
const string sql = """
create table T_Users(
id bigint primary key identity ,
username varchar(255) not null
);
""";
var ast = new Parser().ParseSql(sql, new MsSqlDialect());
Result
Unhandled exception. SqlParser.ParserException: Expected ',' or ')' after column definition, found identity, Line: 2, Col: 27
at SqlParser.Parser.ThrowExpected(String expected, Token actual)
at SqlParser.Parser.ParseColumns()
at SqlParser.Parser.ParseCreateTable(Boolean orReplace, Boolean temporary, Nullable`1 global, Boolean transient)
at SqlParser.Parser.ParseCreate()
at SqlParser.Parser.ParseKeywordStatement(Word word)
at SqlParser.Parser.ParseStatement()
at SqlParser.Parser.ParseStatements()
at SqlParser.Parser.ParseSql(ReadOnlySpan`1 sql, Dialect dialect, ParserOptions options)
at Program.<Main>$(String[] args) in C:\Users\shiloh\code\csharp\learn-csharp\SqlParserDemo\SqlParserDemo\Program.cs:line 12
Process finished with exit code -532,462,766.
Env
Code
Result
Please tell me what went wrong, thanks:)