{"id":19257240,"url":"https://github.com/coinrust/reindexer-rs","last_synced_at":"2025-04-21T15:31:17.083Z","repository":{"id":57659514,"uuid":"228944216","full_name":"coinrust/reindexer-rs","owner":"coinrust","description":"Reindexer library for Rust","archived":false,"fork":false,"pushed_at":"2020-01-16T08:50:54.000Z","size":61,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T12:53:06.265Z","etag":null,"topics":["database","document-oriented","embeddable","in-memory-database","reindexer","reindexer-client","reindexer-library","reindexer-rs","rust","sql-query"],"latest_commit_sha":null,"homepage":"https://github.com/Restream/reindexer","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coinrust.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-19T00:29:01.000Z","updated_at":"2021-06-15T11:17:47.000Z","dependencies_parsed_at":"2022-09-08T00:11:27.391Z","dependency_job_id":null,"html_url":"https://github.com/coinrust/reindexer-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinrust%2Freindexer-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinrust%2Freindexer-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinrust%2Freindexer-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coinrust%2Freindexer-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coinrust","download_url":"https://codeload.github.com/coinrust/reindexer-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250013773,"owners_count":21360810,"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":["database","document-oriented","embeddable","in-memory-database","reindexer","reindexer-client","reindexer-library","reindexer-rs","rust","sql-query"],"created_at":"2024-11-09T19:09:11.811Z","updated_at":"2025-04-21T15:31:16.873Z","avatar_url":"https://github.com/coinrust.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reindexer-rs\nReindexer library for Rust\n\n# Installation (refer to [installation](https://github.com/Restream/reindexer/blob/master/cpp_src/readme.md#installation))\n```\ngo get github.com/restream/reindexer\nsudo apt-get install libgoogle-perftools-dev\ncd $GOPATH/src/github.com/restream/reindexer\nsudo ./dependencies.sh\nmkdir -p build \u0026\u0026 cd build\ncmake ..\nmake -j4\n# optional: step for build swagger documentation\nmake swagger\n# optional: step for build web pages of Reindexer's face\nmake face\n# install to system\nsudo make install\n```\n\n# Build\n```\n# Build\n$ cargo build\n\n# Build examples\n$ cargo build --examples\n\n# Run hello.rs\n$ cargo run --example hello\n```\n\n# Example (builtin)\n```rust,editable\n// builtin\nlet db = Reindexer::new();\n\ndb.connet(\"builtin:///tmp/reindex/testdb\");\n\nlet ns = \"items\";\nlet ok = db.open_namespace(ns);\nassert!(ok);\n\nlet ok = db.add_index(ns, \"id\", \"\", \"hash\", \"int\", false);\nassert!(ok);\n\nlet ok = db.add_index(ns, \"fk_id\", \"\", \"hash\", \"int\", false);\nassert!(ok);\n\nlet ok = db.add_index(ns, \"id+fk_id\", \"id,fk_id\", \"tree\", \"composite\", true);\nassert!(ok);\n\nlet item = r#\"{\"id\":1234, \"value\" : \"value\"}\"#;\nlet ok = db.upsert(ns, item);\nassert!(ok);\n\nlet item = r#\"{\"id\":1235, \"value\" : \"value\"}\"#;\nlet ok = db.upsert(ns, item);\nassert!(ok);\n\nlet (_, ok) = db.update_sql(\"UPDATE items SET ext = 'hello' WHERE id = 1235\");\nassert!(ok);\n\nlet (qr, ok) = db.select(\"SELECT * FROM items WHERE id = 1235\");\nassert!(ok);\n\nlet mut n = 0;\nfor s in qr.iter() {\n    println!(\"item: {}\", s);\n    n += 1;\n    if n \u003e 10 {\n        break;\n    }\n}\n```\n\n# Example (cproto)\n```rust,editable\n// cproto\nlet db = CReindexer::new();\nlet ok = db.connect(\"cproto://127.0.0.1:6534/test_db\");\nassert!(ok);\n\nlet ns = \"items\";\nlet ok = db.open_namespace(ns, true);\nassert!(ok);\n\nlet ok = db.add_index(ns, \"id\", \"hash\", \"int\", true);\nassert!(ok);\n\nlet item = r#\"{\"id\":1234, \"value\" : \"value\"}\"#;\nlet ok = db.upsert(ns, item);\nassert!(ok);\n\nlet item = r#\"{\"id\":1235, \"value\" : \"value\"}\"#;\nlet ok = db.upsert(ns, item);\nassert!(ok);\n\nlet (qr, ok) = db.select(\"SELECT * FROM items\");\nassert!(ok);\n\nfor s in qr.iter() {\n    println!(\"item: {}\", s);\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinrust%2Freindexer-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinrust%2Freindexer-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinrust%2Freindexer-rs/lists"}