diff --git a/edgedb-tokio/src/builder.rs b/edgedb-tokio/src/builder.rs index eb5c3b0d..5dd54006 100644 --- a/edgedb-tokio/src/builder.rs +++ b/edgedb-tokio/src/builder.rs @@ -132,8 +132,9 @@ struct DsnHelper<'a> { query: HashMap, Cow<'a, str>>, } +/// Parsed EdgeDB instance name. #[derive(Clone, Debug)] -enum InstanceName { +pub enum InstanceName { Local(String), Cloud { org_slug: String, @@ -1634,6 +1635,10 @@ impl Config { } } + pub fn instance_name(&self) -> Option<&InstanceName> { + self.0.instance_name.as_ref() + } + /// Secret key if set pub fn secret_key(&self) -> Option<&str> { self.0.secret_key.as_deref() diff --git a/edgedb-tokio/src/lib.rs b/edgedb-tokio/src/lib.rs index 8c5e0b27..4c9a8df9 100644 --- a/edgedb-tokio/src/lib.rs +++ b/edgedb-tokio/src/lib.rs @@ -56,7 +56,7 @@ mod transaction; pub use edgedb_derive::{Queryable, GlobalsDelta, ConfigDelta}; -pub use builder::{Builder, Config}; +pub use builder::{Builder, Config, InstanceName}; pub use credentials::TlsSecurity; pub use client::Client; pub use errors::Error;