1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use async_trait::async_trait;

use super::{SqlFamily, TransactionCapable};

#[derive(Debug, Clone)]
pub struct ExternalConnectionInfo {
    pub sql_family: SqlFamily,
    pub schema_name: String,
}

impl ExternalConnectionInfo {
    pub fn new(sql_family: SqlFamily, schema_name: String) -> Self {
        ExternalConnectionInfo {
            sql_family,
            schema_name,
        }
    }
}

#[async_trait]
pub trait ExternalConnector: TransactionCapable {
    async fn get_connection_info(&self) -> crate::Result<ExternalConnectionInfo>;
}