Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/estie-inc/snowflake-connector-rs
Snowflake Connector for Rust
https://github.com/estie-inc/snowflake-connector-rs
Last synced: about 2 months ago
JSON representation
Snowflake Connector for Rust
- Host: GitHub
- URL: https://github.com/estie-inc/snowflake-connector-rs
- Owner: estie-inc
- License: mit
- Created: 2023-06-25T03:45:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-14T07:09:34.000Z (10 months ago)
- Last Synced: 2024-05-02T05:01:47.075Z (8 months ago)
- Language: Rust
- Homepage:
- Size: 53.7 KB
- Stars: 16
- Watchers: 5
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Snowflake Connector for Rust
[![test](https://github.com/estie-inc/snowflake-connector-rs/actions/workflows/test.yml/badge.svg)](https://github.com/estie-inc/snowflake-connector-rs/actions/workflows/test.yml)
[![Crates.io](https://img.shields.io/crates/v/snowflake-connector-rs)](https://crates.io/crates/snowflake-connector-rs)A Rust client for Snowflake, which enables you to connect to Snowflake and run queries.
```rust
let client = SnowflakeClient::new(
"USERNAME",
SnowflakeAuthMethod::Password("PASSWORD".to_string()),
SnowflakeClientConfig {
account: "ACCOUNT".to_string(),
role: Some("ROLE".to_string()),
warehouse: Some("WAREHOUSE".to_string()),
database: Some("DATABASE".to_string()),
schema: Some("SCHEMA".to_string()),
timeout: Some(std::time::Duration::from_secs(30)),
},
)?;
let session = client.create_session().await?;let query = "CREATE TEMPORARY TABLE example (id NUMBER, value STRING)";
session.query(query).await?;let query = "INSERT INTO example (id, value) VALUES (1, 'hello'), (2, 'world')";
session.query(query).await?;let query = "SELECT * FROM example ORDER BY id";
let rows = session.query(query).await?;
assert_eq!(rows.len(), 2);
assert_eq!(rows[0].get::("ID")?, 1);
assert_eq!(rows[0].get::("VALUE")?, "hello");
```