Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion ampup/src/adbc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<driver>` segment in asset names).
pub fn as_str(&self) -> &'static str {
match self {
Self::Postgresql => "postgresql",
Self::Snowflake => "snowflake",
}
}

Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion docs/features/app-ampup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading