wardenclyffe 0.1.1

A tiny Rust query engine that supports SQL-like filters, CSV scanning, projections, and a custom DSL powered by Pest.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{csv_source::CsvSource, parquet_source::ParquetSource};

pub enum DataSource {
    Csv(CsvSource),
    Parquet(ParquetSource),
}

impl DataSource {
    pub fn open(path: &str) -> Self {
        if path.ends_with(".csv") {
            DataSource::Csv(CsvSource::new(path))
        } else if path.ends_with(".parquet") {
            DataSource::Parquet(ParquetSource::new(path))
        } else {
            panic!("Unsupported file extension");
        }
    }
}