tsqlust
Provide human-friendly errors, warnings, and messages when writing tsql queries
How this is done:
Visitor
traittsqlust::get_diagnostics_for_tsql(&your_sql_str)
Vec<tsqlust::diagnostics::Diagnostic>
and take actionCurrently the project only lexes and parses a basic query
See the tests/
and examples/
directories.
Example REPL session (start via cargo run
):
>> SELECT TOP (5) Id,FirstName, LastName ,* FROM MyTable
Node {
pos: Position {
line: 1,
col: 1
},
tnode: SelectStatement {
top_statement: Some(
Node {
pos: Position {
line: 1,
col: 8
},
tnode: TopStatement {
top_keyword: Node {
pos: Position {
line: 1,
col: 8
},
tnode: Top
},
expr: Node {
pos: Position {
line: 1,
col: 13
},
tnode: Literal {
lit: Int(
5
)
}
},
paren_open: Some(
Node {
pos: Position {
line: 1,
col: 12
},
tnode: ParenOpen
}
),
paren_close: Some(
Node {
pos: Position {
line: 1,
col: 14
},
tnode: ParenClose
}
)
}
}
),
column_name_list: Node {
pos: Position {
line: 1,
col: 16
},
tnode: ColumnNameList {
identifiers: [
Node {
pos: Position {
line: 1,
col: 16
},
tnode: Identifier {
value: "Id"
}
},
Node {
pos: Position {
line: 1,
col: 19
},
tnode: Identifier {
value: "FirstName"
}
},
Node {
pos: Position {
line: 1,
col: 32
},
tnode: Identifier {
value: "LastName"
}
},
Node {
pos: Position {
line: 1,
col: 44
},
tnode: Identifier {
value: "*"
}
}
]
}
},
table_identifier: Node {
pos: Position {
line: 1,
col: 51
},
tnode: Identifier {
value: "MyTable"
}
}
}
}
GPLv3
All of the GitHub Issues are todo and are up for grabs!
If you would like to financially support this project please do the following: