{"id":13672576,"url":"https://github.com/rust-lang/datafrog","last_synced_at":"2025-12-12T15:03:30.034Z","repository":{"id":44881525,"uuid":"133670992","full_name":"rust-lang/datafrog","owner":"rust-lang","description":"A lightweight Datalog engine in Rust","archived":false,"fork":false,"pushed_at":"2022-01-20T20:23:52.000Z","size":171,"stargazers_count":813,"open_issues_count":8,"forks_count":45,"subscribers_count":47,"default_branch":"master","last_synced_at":"2025-03-28T02:48:34.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/rust-lang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-16T13:37:32.000Z","updated_at":"2025-03-26T09:30:52.000Z","dependencies_parsed_at":"2022-08-12T11:40:18.590Z","dependency_job_id":null,"html_url":"https://github.com/rust-lang/datafrog","commit_stats":null,"previous_names":["rust-lang-nursery/datafrog"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fdatafrog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fdatafrog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fdatafrog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-lang%2Fdatafrog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-lang","download_url":"https://codeload.github.com/rust-lang/datafrog/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128753,"owners_count":20888235,"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-08-02T09:01:40.010Z","updated_at":"2025-12-12T15:03:29.711Z","avatar_url":"https://github.com/rust-lang.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# datafrog\n\nDatafrog is a lightweight Datalog engine intended to be embedded in other Rust programs.\n\nDatafrog has no runtime, and relies on you to build and repeatedly apply the update rules.\nIt tries to help you do this correctly. As an example, here is how you might write a reachability\nquery using Datafrog (minus the part where we populate the `nodes` and `edges` initial relations).\n\n```rust\nextern crate datafrog;\nuse datafrog::Iteration;\n\nfn main() {\n    // Prepare initial values, ..\n    let nodes: Vec\u003c(u32,u32)\u003e = vec![\n        // ..\n    ];\n    let edges: Vec\u003c(u32,u32)\u003e = vec![\n        // ..\n    ];\n\n    // Create a new iteration context, ..\n    let mut iteration = Iteration::new();\n\n    // .. some variables, ..\n    let nodes_var = iteration.variable::\u003c(u32,u32)\u003e(\"nodes\");\n    let edges_var = iteration.variable::\u003c(u32,u32)\u003e(\"edges\");\n\n    // .. load them with some initial values, ..\n    nodes_var.insert(nodes.into());\n    edges_var.insert(edges.into());\n\n    // .. and then start iterating rules!\n    while iteration.changed() {\n        // nodes(a,c)  \u003c-  nodes(a,b), edges(b,c)\n        nodes_var.from_join(\u0026nodes_var, \u0026edges_var, |_b, \u0026a, \u0026c| (c,a));\n    }\n\n    // extract the final results.\n    let reachable: Vec\u003c(u32,u32)\u003e = nodes_var.complete();\n}\n```\n\nIf you'd like to read more about how it works, check out [this blog post](https://github.com/frankmcsherry/blog/blob/master/posts/2018-05-19.md).\n\n## Authorship\n\nDatafrog was initially developed by [Frank McSherry][fmc] and was\nlater transferred to the rust-lang-nursery organization. Thanks Frank!\n\n[fmc]: https://github.com/frankmcsherry\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Fdatafrog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frust-lang%2Fdatafrog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frust-lang%2Fdatafrog/lists"}