diff --git a/ampup/src/adbc.rs b/ampup/src/adbc.rs index d34aafe..10f894d 100644 --- a/ampup/src/adbc.rs +++ b/ampup/src/adbc.rs @@ -14,16 +14,18 @@ pub const DRIVER_FILE_PREFIX: &str = "amp-adbc-driver-"; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Driver { Postgresql, + Snowflake, } impl Driver { /// Every supported driver. - pub const ALL: &'static [Driver] = &[Driver::Postgresql]; + pub const ALL: &'static [Driver] = &[Driver::Postgresql, Driver::Snowflake]; /// The driver's canonical name (the `` segment in asset names). pub fn as_str(&self) -> &'static str { match self { Self::Postgresql => "postgresql", + Self::Snowflake => "snowflake", } } @@ -87,11 +89,20 @@ mod tests { asset_name(Driver::Postgresql, Platform::Darwin, Architecture::Aarch64), "adbc-driver-postgresql-darwin-aarch64.tar.gz", ); + assert_eq!( + asset_name(Driver::Snowflake, Platform::Linux, Architecture::Aarch64), + "adbc-driver-snowflake-linux-aarch64.tar.gz", + ); + assert_eq!( + asset_name(Driver::Snowflake, Platform::Darwin, Architecture::X86_64), + "adbc-driver-snowflake-darwin-x86_64.tar.gz", + ); } #[test] fn from_name_accepts_supported_and_rejects_unknown() { assert_eq!(Driver::from_name("postgresql"), Some(Driver::Postgresql)); + assert_eq!(Driver::from_name("snowflake"), Some(Driver::Snowflake)); assert_eq!(Driver::from_name("mysql"), None); assert_eq!(Driver::from_name(""), None); } diff --git a/docs/features/app-ampup.md b/docs/features/app-ampup.md index b188df2..0f1038e 100644 --- a/docs/features/app-ampup.md +++ b/docs/features/app-ampup.md @@ -160,7 +160,7 @@ ampup adbc list ampup adbc uninstall postgresql ``` -Each command defaults to the active amp version and accepts `--version` to target another. `postgresql` is the currently supported driver. Installing requires the target version's binaries to be present, so a driver cannot be stranded under a version that a later `ampup install` would replace. +Each command defaults to the active amp version and accepts `--version` to target another. `postgresql` and `snowflake` are the currently supported drivers. Installing requires the target version's binaries to be present, so a driver cannot be stranded under a version that a later `ampup install` would replace. ## Architecture