vlorql_core/compile/
sqlite.rs1use super::{CompiledQuery, DialectConfig, QueryBuilder, SqlCompiler};
2use crate::errors::VlorQLError;
3use crate::schema::SqlDialect;
4use crate::validate::ValidatedPlan;
5
6#[derive(Debug, Clone, Copy, Default)]
7pub struct SQLiteCompiler;
8
9impl SqlCompiler for SQLiteCompiler {
10 fn compile(&self, plan: &ValidatedPlan) -> Result<CompiledQuery, VlorQLError> {
11 let config = DialectConfig::default_sqlite();
12 let (sql, parameters) = QueryBuilder::new(plan, &config).build()?;
13 Ok(CompiledQuery {
14 sql,
15 parameters,
16 dialect: self.dialect(),
17 })
18 }
19
20 fn dialect(&self) -> SqlDialect {
21 SqlDialect::Sqlite
22 }
23}