{"id":45182770,"url":"https://github.com/dont-rely-on-nulls/sakura","last_synced_at":"2026-04-25T10:37:44.640Z","repository":{"id":272374238,"uuid":"876438032","full_name":"dont-rely-on-nulls/sakura","owner":"dont-rely-on-nulls","description":"An Extended Relational Engine written in OCaml","archived":false,"fork":false,"pushed_at":"2026-04-22T01:49:40.000Z","size":404,"stargazers_count":2,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-04-22T03:35:20.142Z","etag":null,"topics":["ocaml","relational-algebra","relational-database"],"latest_commit_sha":null,"homepage":"http://www.dontrelynulls.org/sakura/","language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dont-rely-on-nulls.png","metadata":{"files":{"readme":"README.org","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-22T01:04:08.000Z","updated_at":"2026-04-21T00:55:12.000Z","dependencies_parsed_at":"2025-01-14T02:35:57.135Z","dependency_job_id":"ab404b2b-e7a2-4830-91aa-4791dec211fb","html_url":"https://github.com/dont-rely-on-nulls/sakura","commit_stats":null,"previous_names":["mmagueta/relational-engine","dont-rely-on-nulls/relational-engine","dont-rely-on-nulls/domino","dont-rely-on-nulls/sakura"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dont-rely-on-nulls/sakura","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dont-rely-on-nulls%2Fsakura","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dont-rely-on-nulls%2Fsakura/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dont-rely-on-nulls%2Fsakura/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dont-rely-on-nulls%2Fsakura/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dont-rely-on-nulls","download_url":"https://codeload.github.com/dont-rely-on-nulls/sakura/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dont-rely-on-nulls%2Fsakura/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32259472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-25T09:15:33.318Z","status":"ssl_error","status_checked_at":"2026-04-25T09:15:31.997Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ocaml","relational-algebra","relational-database"],"created_at":"2026-02-20T10:02:25.114Z","updated_at":"2026-04-25T10:37:44.601Z","avatar_url":"https://github.com/dont-rely-on-nulls.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+TITLE: Sakura\n\n* About\n\nSakura is a semantic-relational algebra engine inspired by\nE. F. Codd's RM/T and D. McGoveran's (as understood by Fabian Pascal)\nSRDM. It models relations in both intension and extension, providing\ntheir manipulation as first-class elements of an algebra.\n\n* Motivation\n\nWe believe the relational model was not ever fully implemented. The\nfundamental necessity of expressing intent and binding meaning\nenclosed to a conceptual model in data is seldom achieved by any\nself-claimed relational database vendor. The emergence of different\nphysically concerned paradigms in the industry demonstrate not only a\nlarge scale amnesia about fundamentals, but also a lethal\nmanifestation of problems that should not exist otherwise. The\nrelational data model as an applied theory is an universally rich and\nconcrete approach to reality that bases itself greatly in\nmoderate-realism applied to mathematics, as described in =An\nAristotelian Realist Philosophy of Mathematics: Mathematics as the\nScience of Quantity and Structure= by J. Franklin. We believe that\nunleashing the full potential of the relational model as refined over\nthe years despite overwhelming disregard of the industry as a whole,\nwill promote efficiency to a new scale never seen, that was very much\nso cut short by relational pretenders and theoretically unsound\napproaches. Our goal is to eliminate the application-database\ndistinction, while maintaining a clear separation between a first\norder predicate logic algebra engine and a higher order predicate\nlogic decision engine (application) via an embedded data sublanguage\nwith Sakura as a possible auxiliary runtime.\n\n* Current State\n\n** What Works Today\n\n- Base finite relations: create, insert, retract, clear\n- Built-in immutable/generated domains on database creation:\n  =integer=, =natural=, =rational=, =string=, =atom=, =term=\n- Query DSL in =query_planner= and =repl=:\n  - base relation scan (using relation atom)\n  - =select=, =project=, =join=, =theta_join=, =sort=, =take=, =rename=\n  - =materialize= (plan-level, with caveats)\n- Volcano-style iterator execution model (process-per-operator)\n- Visual output modes in =visualizer= (table/tree/nested views)\n- XML TCP server protocol commands: =QUERY=, =NEXT=, =CLOSE=\n\n** Known Gaps / Reliability Risks\n\n- Lack of constraints greater than 1OPs;\n- =repl:start/0= is destructive: it calls =main:setup/0=, which recreates schema;\n- =xml_server= =SCHEMA= path is currently fragile with constraints representation;\n- Constraint/intension representation is not yet fully normalized across modules;\n- Planner contains dual compilation styles (iterator path + relation path);\n- Blocking operators (for example =sort=) over infinite relations can time out unless bounded with =take= first;\n- There is currently no substantial automated test suite in-repo despite CI hooks;\n\nSee =docs/reliability_roadmap.org= for the detailed remediation plan.\n\n* Architecture (High Level)\n\n- =src/operations.erl= :: core storage/versioning and iterator primitives\n- =src/constraint.erl= :: domain constraints, inference, validation\n- =src/generators.erl= :: infinite relation generators\n- =src/relational_operators.erl= :: pure relation-to-relation algebra operators\n- =src/query_planner.erl= :: tuple DSL parsing/validation/execution planning\n- =src/repl.erl= :: shell-facing query convenience API\n- =src/xml_server.erl= :: TCP/XML query interface\n- =src/visualizer.erl= :: renderers for result tuples\n\nData model records are defined in =include/operations.hrl=.\n\n* Query DSL\n\nPlans are Erlang tuples:\n\n- base relation: =employees=\n- selection: ={select, employees, fun(T) -\u003e maps:get(age, T) \u003e 30 end}=\n- projection: ={project, employees, [name, age]}=\n- equijoin: ={join, employees, departments, dept_id}=\n- theta join: ={theta_join, Left, Right, Pred2}=\n- sort: ={sort, Plan, Comparator2}=\n- take: ={take, Plan, N}=\n- rename: ={rename, old_attr, new_attr, Plan}=\n\n* Running\n\n** Compile\n\n#+begin_src sh\nrebar3 compile\n#+end_src\n\n** REPL\n\n#+begin_src erlang\nrepl:start().\nDB = repl:example_db().\nrepl:q(DB, employees).\nrepl:q(DB, {take, {sort, employees,\n                  fun(A,B) -\u003e maps:get(age,A) =\u003c maps:get(age,B) end}, 3}).\n#+end_src\n\n** XML Server (manual)\n\nStart server from Erlang shell, then send line commands over TCP:\n\n- =QUERY \u003cplan\u003e=\n- =NEXT \u003csession_id\u003e \u003cn\u003e=\n- =CLOSE \u003csession_id\u003e=\n\n* Design Intent\n\nSakura aims to treat relations as algebraic manipulation units with both:\n\n- extension (actual tuples, finite or generated)\n- intension (schema + constraints + derivation meaning)\n\nThe current engine already exposes the extension side robustly for\nmany operations, despite the lack of constraints greater than 1OP.\nThe main active work is making intension handling fully consistent and\nreliable across planners/operators/protocols.\n\n* Roadmap and Docs\n\n- =docs/reliability_roadmap.org= :: precise reliability + correctness roadmap\n- =docs/code.org= :: code-oriented notes\n- =docs/features.org= :: feature notes (may contain older planning context)\n- =docs/constraints.org= :: constraint model notes\n\n* References\n\n- Codd, E. F. (1970), \"A Relational Model of Data for Large Shared Data Banks\"\n- Codd, E. F. (1979), \"Extending the Database Relational Model to Capture More Meaning\"\n\n* License\n\nSee =LICENSE=.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdont-rely-on-nulls%2Fsakura","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdont-rely-on-nulls%2Fsakura","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdont-rely-on-nulls%2Fsakura/lists"}