https://github.com/if0ne/adbc-clickhouse
ADBC Driver for Clickhouse
https://github.com/if0ne/adbc-clickhouse
adbc clickhouse
Last synced: 11 days ago
JSON representation
ADBC Driver for Clickhouse
- Host: GitHub
- URL: https://github.com/if0ne/adbc-clickhouse
- Owner: if0ne
- Created: 2025-11-10T08:06:33.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-11-13T12:52:49.000Z (7 months ago)
- Last Synced: 2025-12-27T05:59:56.540Z (5 months ago)
- Topics: adbc, clickhouse
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ADBC Driver for Clickhouse
## Example usage
```rust
use adbc_core::{
Connection, Database, Driver,
options::{OptionDatabase, OptionValue},
};
use adbc_clickhouse::driver::ClickhouseDriver;
fn main() {
let mut driver = ClickhouseDriver::default();
let database = driver
.new_database_with_opts([
(
OptionDatabase::Uri,
OptionValue::String("localhost:9000".to_string()),
),
(
OptionDatabase::Username,
OptionValue::String("username".to_string()),
),
(
OptionDatabase::Password,
OptionValue::String("password".to_string()),
),
(
OptionDatabase::Other("clickhouse.schema".to_string()),
OptionValue::String("default".to_string()),
)
])
.unwrap();
let connection = database.new_connection().unwrap();
let batch = connection
.get_objects(
adbc_core::options::ObjectDepth::All,
None,
None,
None,
None,
None,
)
.unwrap()
.collect::>()
.into_iter()
.filter_map(|s| s.ok())
.collect::>();
arrow::util::pretty::print_batches(&batch).unwrap();
}
```