Status: FlowLog is under active development; interfaces may change without notice.
flowlog-build compiles a Datalog (.dl) program into a Rust module your
crate include!s from build.rs. It pairs with
flowlog-runtime, which supplies
the dataflow primitives the generated code depends on.
If you want a standalone Datalog-to-Rust CLI instead of a build-script
integration, see the flowlog-compiler binary in the
FlowLog repo.
Setup
# Cargo.toml
[]
= "0.2"
[]
= "0.2"
// build.rs
// src/lib.rs
use DatalogBatchEngine;
let mut engine = new; // 4 timely workers
engine.insert_edge;
let results = engine.run;
The generated module exposes one insert_<relation> method per input
relation declared in the .dl program, plus a run() that returns all
output relations.
Advanced Options
Use Builder when you need multiple programs, include directories, UDFs,
or non-default codegen flags:
use Builder;
// build.rs
See the API docs for the full Builder surface.
Error Rendering
The free compile() function renders any pipeline diagnostic against the
source map and surfaces it through io::Error, so cargo build shows a
source-annotated error. Builder::compile returns the structured
BoxError instead if you want to format it yourself.
License
Apache-2.0 — see LICENSE.