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.diagnosticswith 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. Eight ship in ekos/plugins/sql-dialect-*: postgres, mysql, mssql, snowflake, databricks, clickhouse, trino and oracle.
A pass that calls another analyzer's functions must fold that analyzer's logic version into its own cache key, or it reuses stale output when the other analyzer changes.
Providers
LlmProvider (complete, streaming variant, model_name) and EmbeddingProvider are injected by trait, so a new backend needs no change to callers.