{"id":20578072,"url":"https://github.com/timeplus-io/proton-rust-client","last_synced_at":"2025-04-14T19:05:11.111Z","repository":{"id":221625359,"uuid":"754921615","full_name":"timeplus-io/proton-rust-client","owner":"timeplus-io","description":"Rust client for Timeplus Proton, a fast and lightweight streaming SQL engine","archived":false,"fork":false,"pushed_at":"2024-10-01T00:06:23.000Z","size":108,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-11-08T10:52:11.050Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://crates.io/crates/proton_client","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timeplus-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-09T02:54:51.000Z","updated_at":"2024-10-10T09:34:29.000Z","dependencies_parsed_at":"2024-02-11T17:26:21.441Z","dependency_job_id":"66a369c2-8c4a-40a9-9638-c32df771296c","html_url":"https://github.com/timeplus-io/proton-rust-client","commit_stats":null,"previous_names":["marvin-hansen/proton-rs","marvin-hansen/proton-rust-client","timeplus-io/proton-rust-client"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeplus-io%2Fproton-rust-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeplus-io%2Fproton-rust-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeplus-io%2Fproton-rust-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timeplus-io%2Fproton-rust-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timeplus-io","download_url":"https://codeload.github.com/timeplus-io/proton-rust-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224880388,"owners_count":17385370,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T06:10:20.318Z","updated_at":"2024-11-16T06:10:20.781Z","avatar_url":"https://github.com/timeplus-io.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[//]: # (---)\n[//]: # (SPDX-License-Identifier: Apache-2.0)\n[//]: # (---)\n\n#  Rust Client for Timeplus Proton\n\nRust client for [Timeplus Proton](https://github.com/timeplus-io/proton).\n\nProton is a streaming SQL engine, a fast and lightweight alternative to Apache Flink, 🚀 powered by ClickHouse. It enables developers to solve streaming data processing, routing and analytics challenges from Apache Kafka, Redpanda and more sources, and send aggregated data to the downstream systems. Proton is the core engine of [Timeplus](https://timeplus.com), which is a cloud native streaming analytics platform.\n\nThe initial version(0.1.0) of the client was written by [Marvin Hansen](https://github.com/marvin-hansen). Thanks for the contribution.\n\nThis client uses https://crates.io/crates/clickhouse as a dependency.\n\n## Install Proton\n\nPlease install Proton as a standalone server or via Docker. Make sure either port 8123 or 3218 is exposed for `pront-rust-client` to connect and run SQL.\n* 8123 is the port to run DDL and queries in historical mode\n* 3218 is the port to run DDL and quries in streaming mode by default. You can still wrap the stream with `table(..)` function to query them in historical mode.\n\nLearn more\n* [SQL syntax](https://docs.timeplus.com/query-syntax)\n* [Proton ports](https://docs.timeplus.com/proton-ports)\n\n### As a single binary\n\nOn Linux or Mac, you can install it via `curl https://install.timeplus.com | sh`\n\nOn Mac, you can also install it via `brew install proton`\n\nAfter you get the `proton` binary, you can start the Proton server via `proton server start`\n\nIn a separate terminal, connect to the server via `proton client` (Note: If you encounter a 'connection refused' error, use: proton client --host 127.0.0.1)\n\n### As a Docker container\n\n```bash\ndocker run -d --pull always --name proton -p 8123:8123 -p 8463:8463 ghcr.io/timeplus-io/proton:latest\n```\n\nProton is automatically started with port 8123 and 8463 exposed. Open the terminal of the container, and run `proton client`\n\nFor detailed usage and more information, check out the documentation: https://docs.timeplus.com/proton\n\n\n## Install ProtonClient\n\nAdd the proton client to your project by running in a terminal:\n\n```\ncargo add proton_client\n```\n\nor by adding the following to your Cargo.toml:\n\n```\n[dependencies]\n\nproton_client =  { version = \"0.1.0\"}\n```\n\n\n## Use ProtonClient\n\n```Rust\nuse proton_client::prelude::{ProtonClient, Result};\n\nconst FN_NAME: \u0026str = \"[prepare]:\";\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    println!(\"{}Start\", FN_NAME);\n\n    println!(\"{}Build client\", FN_NAME);\n    let client = ProtonClient::new(\"http://localhost:8123\");\n\n    println!(\"{}Create stream if not exists\", FN_NAME);\n    create_stream(\u0026client)\n        .await\n        .expect(\"[main]: Failed to create Stream\");\n\n    println!(\"{}Stop\", FN_NAME);\n    Ok(())\n}\n\npub async fn create_stream(client: \u0026ProtonClient) -\u003e Result\u003c()\u003e {\n     client\n         .execute_query(\"CREATE STREAM IF NOT EXISTS test_stream(no uint32, name string) ORDER BY no\")\n         .await\n}\n```\n\n## Run the examples\n\n```bash\nmake example\n```\n\nWhich shows:\n\n```text\n-----------------------------------------\nSelect the number of the example to run:\n-----------------------------------------\n1) prepare: Prepare Proton for the examples: create table \u0026 load data\n2) query: Query Proton with sample queries\n3) remove: Cleanup Proton and delete streams\n4) quit: Exit\n\n-----------------------------------------\nMake sure Proton is running\n-----------------------------------------\n```\n\nPlease select the number of the example to run. Also,\nfirst run the prepare example to prepare Proton for the query example.\nSee the code of all examples [here](examples).\n\n## What's next?\n\nTo see more examples of using Proton, check out the [examples](https://github.com/timeplus-io/proton/tree/develop/examples) folder in Proton repo.\n\nPlease note, by default the SQL queries are in streaming mode. Learn more about SQL syntax at [Proton Documentation](https://docs.timeplus.com/query-syntax).\n\n\n## Documentation\n\nYou find the full documentation for Proton at [docs.timeplus.com](https://docs.timeplus.com/proton) alongside documentation for the Timeplus (Cloud and BYOC) platform.\n\n## Contributing\n\nWe welcome your contributions!\n\n## Need help?\n\nJoin our [Timeplus Community Slack](https://timeplus.com/slack) to connect with Timeplus engineers and other Proton users.\n\nFor filing bugs, suggesting improvements, or requesting new features, see the [open issues](https://github.com/timeplus-io/proton-rust-client/issues) here on GitHub.\n\n## Licensing\n\nProton Rust Client uses Apache License 2.0. See details in the [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimeplus-io%2Fproton-rust-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimeplus-io%2Fproton-rust-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimeplus-io%2Fproton-rust-client/lists"}