EKOSdocs
Docs / Plugins Build

Compiler Plugins

Add analysis with a CompilerPass, or teach EKOS a SQL dialect.

#[async_trait]
pub trait CompilerPass: Send + Sync {
    fn name(&self) -> &str;
    fn dependencies(&self) -> &[&str] { &[] }
    fn version(&self) -> &str { "v1" }
    fn cache_inputs(&self) -> Vec<String> { Vec::new() }
    async fn run(&mut self, ctx: &mut PassContext) -> Result<(), PassError>;
}
  • Passes must be deterministic and side-effect-free.
  • version — bump it whenever behaviour changes so cached output is not reused.
  • cache_inputs — opaque identifiers of what the pass reads (content hashes, artifact ids).
  • Report problems through ctx.diagnostics with a code; do not panic.

SQL dialects

Implement SqlDialectParser (sql-dialect-sdk): a name() matching the dialect value in [recover.sql], the sqlparser dialect to use, and dialect-specific preprocess transforms. Six ship in ekos/plugins/sql-dialect-*.

Providers

LlmProvider (complete, streaming variant, model_name) and EmbeddingProvider are injected by trait, so a new backend needs no change to callers.