Why I love Rust for tokenising and parsing
The author develops a Rust-based static analysis tool for SQL, named sqleibniz, focusing on syntax checks and validation for SQLite, emphasizing error message quality and employing table-driven tests.
Read original articleThe blog post discusses the author's experience using Rust for developing a static analysis tool for SQL, named sqleibniz, specifically targeting the SQLite dialect. The tool aims to perform syntax checks and validate the existence of tables, columns, and functions in SQL input. The author emphasizes the importance of providing high-quality error messages with context and explanations. The development process involves creating a tokenizer and parser for SQL, leveraging Rust's features such as macros for code deduplication and testing. The author highlights the use of macros to define structures and implement traits, which reduces code duplication. Additionally, the post details the author's approach to testing, including the creation of table-driven tests similar to those in Go, to ensure the functionality of the lexer and parser. The author expresses enthusiasm for Rust's capabilities in handling these tasks and plans to extend the project by developing a Language Server Protocol (LSP) server for SQL.
- The author is developing a static analysis tool for SQL called sqleibniz using Rust.
- The tool aims to perform syntax checks and validate SQL input against SQLite standards.
- Rust's macros are utilized for code deduplication and defining structures efficiently.
- The author emphasizes the importance of high-quality error messages in the tool's output.
- Testing is conducted using table-driven tests to ensure the functionality of the lexer and parser.
Related
First Contact with SQLite
The article explores surprising aspects of SQLite, like limitations in altering columns and data types. It notes the recent jsonb support and handling date/time values, praising SQLite's streaming features but favoring PostgreSQL.
Rust's Ugly Syntax (2023)
The blog post addresses complaints about Rust's syntax, attributing them to misunderstandings of its semantics. It suggests simplifying semantics for readability while maintaining performance and safety features.
Build a quick Local code intelligence using Ollama with Rust
Bosun developed Swiftide, a Rust-based tool for efficient code indexing and querying, utilizing Qdrant and FastEmbed. It enhances performance with OpenTelemetry, integrating various language models for improved response times.
Sq.io: jq for databases and much more
sq is an open-source data wrangling tool that facilitates data inspection, querying, and manipulation across various databases and file formats, featuring a user-friendly command structure and comprehensive documentation.
I love Rust for tokenising and parsing
The author develops a Rust-based static analysis tool for SQL, sqleibniz, focusing on syntax checks and validation, utilizing macros for code efficiency, and plans to implement an LSP server.
Related
First Contact with SQLite
The article explores surprising aspects of SQLite, like limitations in altering columns and data types. It notes the recent jsonb support and handling date/time values, praising SQLite's streaming features but favoring PostgreSQL.
Rust's Ugly Syntax (2023)
The blog post addresses complaints about Rust's syntax, attributing them to misunderstandings of its semantics. It suggests simplifying semantics for readability while maintaining performance and safety features.
Build a quick Local code intelligence using Ollama with Rust
Bosun developed Swiftide, a Rust-based tool for efficient code indexing and querying, utilizing Qdrant and FastEmbed. It enhances performance with OpenTelemetry, integrating various language models for improved response times.
Sq.io: jq for databases and much more
sq is an open-source data wrangling tool that facilitates data inspection, querying, and manipulation across various databases and file formats, featuring a user-friendly command structure and comprehensive documentation.
I love Rust for tokenising and parsing
The author develops a Rust-based static analysis tool for SQL, sqleibniz, focusing on syntax checks and validation, utilizing macros for code efficiency, and plans to implement an LSP server.