8000 GitHub - jolks/ScratchDB: Scratch is an open-source alternative to BigQuery, Redshift, and Snowflake. Runs on Clickhouse.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Scratch is an open-source alternative to BigQuery, Redshift, and Snowflake. Runs on Clickhouse.

License

Notifications You must be signed in to change notification settings

jolks/ScratchDB

 
 

Repository files navigation

ScratchDB

ScratchDB is a wrapper around Clickhouse that lets you input arbitrary JSON and perform analytical queries against it. It automatically creates tables and columns when new data is added.

Quickstart

1. Run the server

Clone the repo:

$ git clone git@github.com:scratchdata/ScratchDB.git
$ cd ScratchDB

Start clickhouse and localstack:

$ docker-compose up

In a separate terminal, start the insert service:

$ go run . insert

Finally, in an additional terminal window, start the ingest service:

$ go run . ingest

2. Insert JSON data

$ curl -X POST http://localhost:3000/data \
    -H 'Content-Type: application/json' \
    -H 'X-Api-Key: local' \
    -d '{"table":"my_table","data":{"fruit": "apple"}}'

3. Query

To view data in JSON format: http://localhost:3000/query?q=select * from my_table

curl -H 'X-Api-Key: local' "http://localhost:3000/query?q=select%20*%20from%20my_table"

To view data in an HTML table: http://localhost:3000/query?format=html&q=select * from my_table

curl -H 'X-Api-Key: local' "http://localhost:3000/query?format=html&q=select%20*%20from%20my_table"

About

Scratch is an open-source alternative to BigQuery, Redshift, and Snowflake. Runs on Clickhouse.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.4%
  • Shell 0.6%
0