Code segmenter for SQL. This class uses Tree-sitter to segment SQL code into its constituent statements (e.g., SELECT, CREATE TABLE). It also provides functionality to extract these statements and simplify the code into commented descriptions.
SQLSegmenter(
self,
code: str,
)Return the SQL language grammar for Tree-sitter.
Return the Tree-sitter query for SQL segmentation.
Extract SQL statements from the code. Ensures that all SQL statements end with a semicolon for consistency.
Simplify the extracted SQL code into comments. Converts SQL statements into commented descriptions for easy readability.
Create a line comment in SQL style.