|
The author avoided writing a SQL parser by creating Prela, a query language implemented in Rust types and methods, but faced performance issues with dynamic queries since compilation takes longer than execution. To support ad hoc queries, they embedded Lua as a query language, implementing relational operators that return AST nodes instead of executing immediately, allowing Lua's syntax and features like variables and arithmetic expressions to work seamlessly with the database backend. This approach leverages operator overloading in Lua to represent database operations efficiently while maintaining the benefits of an embedded scripting language.
Read Full Article →
← Back to latest