use std::fmt;
use narwhal_core::ConnectionConfig;
use secrecy::SecretString;
use uuid::Uuid;
use super::fields::WizardField;
pub const DRIVERS: &[&str] = &["sqlite", "postgres", "mysql", "clickhouse", "duckdb"];
#[derive(Debug)]
pub struct ConnectionWizard {
pub driver_index: usize,
pub fields: Vec<WizardField>,
pub focused: usize,
pub existing_id: Option<Uuid>,
}
impl Default for ConnectionWizard {
fn default() -> Self {
Self::new()
}
}
pub struct Built {
pub config: ConnectionConfig,
pub password: Option<SecretString>,
}
impl fmt::Debug for Built {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Built")
.field("config", &self.config)
.field("password", &self.password.as_ref().map(|_| "***"))
.finish()
}
}