1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use crate::introspection::IntrospectionResponse;
use crate::{config::Config, engine::Engine, session::Session};

pub fn get_schema() -> eyre::Result<IntrospectionResponse> {
    let cfg = Config::new(None, None, None, None);

    //TODO: Implement context for proc
    let (conn, _proc) = Engine::new().start(&cfg)?;
    let session = Session::new();
    let req_builder = session.start(&cfg, &conn)?;
    let schema = session.schema(req_builder)?;

    Ok(schema)
}

#[cfg(test)]
mod tests {
    use super::get_schema;

    #[test]
    fn can_get_schema() {
        let _ = get_schema().unwrap();
    }
}