⚠️ Work in progress
This website (and Lutra project as a whole) is a work in progress. It describes what we want Lutra to become, not what it is yet. The content might be outdated, incomplete or might contain typos.
See project status.
Rust and PostgreSQL
Lutra projects can be compiled to SQL and executed on relational databases.
The Lutra database driver acts as a wrapper around existing drivers. It handles parameter encoding, program execution, and result decoding into data structures native to the target programming language.
Supported databases:
Example
We start with a Lutra project.
module db {
type Movie: {id: int32, title: text}
let movies: func (): [Movie]
}
func -> (
| -> x.id == param)
|
)
This project can be compiled to Rust type definitions and SQL query using lutra-codegen
(ideally in build.rs
file).
Then we can use types and programs from the Lutra project in Rust code, by including generated code in our crate.
// main.rs
// include code generated from our Lutra project
use SyncRun;