Skip to content

Commit

Permalink
feat(rust/driver/snowflake): add adbc_snowflake crate with Go drive…
Browse files Browse the repository at this point in the history
…r wrapper (#2207)

This PR adds the `adbc_snowflake` crate to the Rust workspace. This
crate provides a Snowflake ADBC driver for Rust by wrapping the Go
driver, loaded by the Rust driver manager implementation. The `build.rs`
script builds the Go driver and links it statically.

- [x] Add methods to the wrapper structs to handle Snowflake specific
configurations
- [x] Add a feature to support loading the Go driver dynamically
- [x] Docs
- [x] Tests
  • Loading branch information
mbrobbel authored Nov 22, 2024
1 parent bac4fc6 commit 8de65c8
Show file tree
Hide file tree
Showing 29 changed files with 3,148 additions and 112 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ jobs:
run: |
rustup toolchain install stable --no-self-update
rustup default stable
- name: Get required Go version
run: |
(. ../.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version: "${{ env.GO_VERSION }}"
check-latest: true
cache: true
cache-dependency-path: go/adbc/go.sum
- name: Install Protoc
if: runner.os == 'Linux'
run: |
Expand Down Expand Up @@ -104,10 +113,16 @@ jobs:
if: matrix.os == 'macos-13'
run: |
echo "DYLD_LIBRARY_PATH=/usr/local/opt/sqlite/lib:${{ github.workspace }}/build/lib:$DYLD_LIBRARY_PATH" >> "$GITHUB_ENV"
- name: Set search dir for Snowflake Go lib
run: echo "ADBC_SNOWFLAKE_GO_LIB_DIR=${{ github.workspace }}/build/lib" >> "$GITHUB_ENV"
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -Dwarnings
- name: Test
run: cargo test --workspace --all-targets --all-features
# env:
# ADBC_SNOWFLAKE_TESTS: 1
# ADBC_SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
# ADBC_SNOWFLAKE_SQL_DB: ADBC_TESTING
- name: Doctests
run: cargo test --workspace --doc --all-features
- name: Check docs
Expand Down
4 changes: 3 additions & 1 deletion dev/release/post-08-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ main() {

pushd "${SOURCE_TOP_DIR}/rust"
cargo publish --all-features -p adbc_core
cargo publish -p adbc_snowflake
popd

echo "Success! The released Cargo crate is available here:"
echo "Success! The released Cargo crates are available here:"
echo " https://crates.io/crates/adbc_core"
echo " https://crates.io/crates/adbc_snowflake"
}

main "$@"
Loading

0 comments on commit 8de65c8

Please sign in to comment.