Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kovalevdima/clickhaskell
Haskell implementation of ClickHouse Native protocol
https://github.com/kovalevdima/clickhaskell
clickhouse haskell nix open-source
Last synced: 12 days ago
JSON representation
Haskell implementation of ClickHouse Native protocol
- Host: GitHub
- URL: https://github.com/kovalevdima/clickhaskell
- Owner: KovalevDima
- License: bsd-3-clause
- Created: 2023-03-23T12:44:26.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-17T00:39:38.000Z (16 days ago)
- Last Synced: 2025-01-21T00:46:05.213Z (12 days ago)
- Topics: clickhouse, haskell, nix, open-source
- Language: Haskell
- Homepage: https://clickhaskell.dev/
- Size: 500 KB
- Stars: 20
- Watchers: 4
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# ClickHaskell
Haskell implementation of [ClickHouse](https://clickhouse.com/) DBMS Native protocol and client
Surf across [Home page](https://clickhaskell.dev/) to learn everything you need
## ⚠️ Current version is unstable
ClickHaskell 1.0.0 will be released after most of the negative case tests have been implemented. Until then, you may encounter unexpected behavior# Design
ClickHaskell was designed to **avoid boilerplate** code\
and **decouple business logic** from DBMS protocol implementationThe key idea is to specilize database **table**/**query**/**view** interface\
as a Haskell type and then to constuct a correspondence\
(**decoder**/**encoder** and **query**) from **record generic representation**For example in case of
```text
Table <-- Record
├name1 : Type1 encoder ├name1 : Type1
├name2 : Type2 ├name2 : Type2
... decoder ...
└nameN : TypeN --> └nameM : TypeM
```
we can construct queries and decoders/encoders \
for server/client packets with dataAlso we can construct queries like
```sql
SELECT name1, name2, ..., nameN FROM tableName
SELECT name1, name2, ..., nameN FROM viewName(...)
INSERT name1, name2, ..., nameN INTO tableName
```
and combine it with encoder/decoder to generate\
end-to-end database communication functions which\
only takes a data on runtime