1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use {
    crate::GitStorage,
    async_trait::async_trait,
    gluesql_core::{
        data::{Key, Schema},
        error::Result,
        store::{DataRow, RowIter, Store},
    },
};

#[async_trait(?Send)]
impl Store for GitStorage {
    async fn fetch_all_schemas(&self) -> Result<Vec<Schema>> {
        self.get_store().fetch_all_schemas().await
    }

    async fn fetch_schema(&self, table_name: &str) -> Result<Option<Schema>> {
        self.get_store().fetch_schema(table_name).await
    }

    async fn fetch_data(&self, table_name: &str, key: &Key) -> Result<Option<DataRow>> {
        self.get_store().fetch_data(table_name, key).await
    }

    async fn scan_data(&self, table_name: &str) -> Result<RowIter> {
        self.get_store().scan_data(table_name).await
    }
}