1 unstable release
0.0.1 | Jul 2, 2023 |
---|
#42 in #clickhouse
34KB
818 lines
Streamhouse
A strongly typed client for ClickHouse that returns a stream of rows.
- Uses simple
Row
trait (notserde
!) for encoding/decoding rows. - Uses
RowBinaryWithNamesAndTypes
encoding to ensure type safety. - Supports HTTP (and HTTPS unknown?).
- Provides API for selecting.
- Provides API for inserting.
- TODO: Compression and decompression (LZ4).
Comparison with the clickhouse
crate
- Both provide similar performance, with
clickhouse
being a little faster. - Unlike
clickhouse
which has an unsound API,streamhouse
does not use unsafe (and thus provides a sound API). streamhouse
provides afutures::Stream
of rows, whereclickhouse
only creates a stream-likeRowCursor
.- In
clickhouse
, an error in which two columns are swapped in order can give incorrect results. Withstreamhouse
this error is caught and reported. - Because
clickhouse
usesserde
internally, it is not convenient to create a type that can be used with a different serialization (e.g. when converted to JSON) than its internal representation in clickhouse.streamhouse
uses its own traits, so your types can have independent representations as clickhouse columns versus other serializations you may wish to use.
Dependencies
~7–16MB
~194K SLoC