1 unstable release

0.0.1 Jul 2, 2023

#33 in #clickhouse

MIT/Apache

34KB
818 lines

Streamhouse   Latest version Documentation Build status

A strongly typed client for ClickHouse that returns a stream of rows.

  • Uses simple Row trait (not serde!) 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 a futures::Stream of rows, where clickhouse only creates a stream-like RowCursor.
  • In clickhouse, an error in which two columns are swapped in order can give incorrect results. With streamhouse this error is caught and reported.
  • Because clickhouse uses serde 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
~197K SLoC