https://github.com/scratchdata/ScratchDB Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} scratchdata / ScratchDB Public * Notifications * Fork 19 * Star 258 Scratch is an open-source alternative to BigQuery, Redshift, and Snowflake. Runs on Clickhouse. www.scratchdb.com License AGPL-3.0 license 258 stars 19 forks Activity Star Notifications * Code * Issues 18 * Pull requests 7 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights scratchdata/ScratchDB This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 6 branches 12 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/s] Use Git or checkout with SVN using the web URL. [gh repo clone scratc] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @poundifdef poundifdef Merge pull request #36 from maxmcd/ improve-quickstart-instructions ... 0789e23 Oct 27, 2023 Merge pull request #36 from maxmcd/improve-quickstart-instructions Add more detail to quickstart instructions 0789e23 Git stats * 91 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github add codeowners October 13, 2023 08:39 client Fix data race October 12, 2023 19:18 config Limit Clickhouse allocations October 12, 2023 21:28 deploy update deploy params September 15, 2023 10:52 docker/localstack Set up local resources October 14, 2023 12:44 importer Reuse connection and close after use. October 12, 2023 21:35 ingest Fix data race October 12, 2023 19:18 util Add utility function September 15, 2023 09:53 .gitignore Split credentials for different providers October 12, 2023 19:18 .goreleaser.yaml updates August 11, 2023 10:18 LICENSE Initial commit July 10, 2023 16:15 README.md Add more detail to quickstart instructions October 27, 2023 19:45 config.toml Set up local resources October 14, 2023 12:44 docker-compose.yml Set up local resources October 14, 2023 12:44 go.mod Reuse connection and close after use. October 12, 2023 21:35 go.sum Split credentials for different providers October 12, 2023 19:18 main.go Split credentials for different providers October 12, 2023 19:18 View code ScratchDB Quickstart 1. Run the server 2. Insert JSON data 3. Query README.md 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. www.scratchdb.com Topics bigquery clickhouse snowflake data-warehouse olap redshift hacktoberfest Resources Readme License AGPL-3.0 license Activity Stars 258 stars Watchers 1 watching Forks 19 forks Report repository Releases 8 v0.10.0 Latest Oct 16, 2023 + 7 releases Packages 0 No packages published Contributors 3 * @poundifdef poundifdef Jay Goel * @chumaumenze chumaumenze Chuma Umenze * @maxmcd maxmcd Max McDonnell Languages * Go 99.1% * Shell 0.9% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.