zql_cli/db/plugin/
basic.rs1use crate::core::catalog::Catalog;
2use crate::db::context::Context;
3use crate::db::database::{Database, Plugin};
4use crate::error::MyResult;
5
6pub struct BasicPlugin {
7 batch: String,
8}
9
10impl BasicPlugin {
11 pub fn new<T: Into<String>>(batch: T) -> Self {
12 let batch = batch.into();
13 Self { batch }
14 }
15}
16
17impl Plugin for BasicPlugin {
18 fn populate_catalog(&self, _database: &Database, _catalog: &mut Catalog) -> MyResult<()> {
19 Ok(())
20 }
21
22 fn query_context(&self, _database: &Database) -> Context {
23 Context::default()
24 }
25
26 fn get_batch(&self) -> &str {
27 &self.batch
28 }
29}