{"id":51143043,"url":"https://github.com/thanos/terminusdb-client-elixir","last_synced_at":"2026-06-26T01:00:47.832Z","repository":{"id":366904457,"uuid":"1278257092","full_name":"thanos/terminusdb-client-elixir","owner":"thanos","description":"An elixir client for the TerminusDB","archived":false,"fork":false,"pushed_at":"2026-06-23T19:15:20.000Z","size":50,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T21:12:23.190Z","etag":null,"topics":["api-client","beam","elixir","knowledge-graph","terminusdb"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thanos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2026-06-23T16:05:47.000Z","updated_at":"2026-06-23T16:31:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thanos/terminusdb-client-elixir","commit_stats":null,"previous_names":["thanos/terminusdb-client-elixir"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/thanos/terminusdb-client-elixir","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanos%2Fterminusdb-client-elixir","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanos%2Fterminusdb-client-elixir/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanos%2Fterminusdb-client-elixir/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanos%2Fterminusdb-client-elixir/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thanos","download_url":"https://codeload.github.com/thanos/terminusdb-client-elixir/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thanos%2Fterminusdb-client-elixir/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34709804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api-client","beam","elixir","knowledge-graph","terminusdb"],"created_at":"2026-06-26T01:00:34.527Z","updated_at":"2026-06-26T01:00:47.799Z","avatar_url":"https://github.com/thanos.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terminusdb_ex\n\n[![Hex.pm Version](https://img.shields.io/hexpm/v/terminusdb_client.svg)](https://hex.pm/packages/terminusdb_client)\n[![Hex.pm License](https://img.shields.io/hexpm/l/terminusdb_client.svg)](https://hex.pm/packages/terminusdb_client)\n[![HexDocs](https://img.shields.io/badge/docs-hexdocs-blue.svg)](https://hexdocs.pm/terminusdb_client)\n[![CI](https://github.com/thanos/terminusdb-client-elixir/actions/workflows/ci.yml/badge.svg)](https://github.com/thanos/terminusdb-client-elixir/actions/workflows/ci.yml)\n[![Coverage](https://coveralls.io/repos/github/thanos/terminusdb-client-elixir/badge.svg?branch=main)](https://coveralls.io/github/thanos/terminusdb-client-elixir)\n\nAn idiomatic Elixir client for [TerminusDB](https://terminusdb.org), the document\ngraph database with built-in version control. It is built on\n[Req](https://hexdocs.pm/req) and treats connection context as **immutable data**,\nmaking it safe for concurrent use.\n\n\u003e **Status:** v0.3.1. `Config`, `Error`, `Telemetry`, `Client`, `Database`,\n\u003e `Document` (with streaming), `Schema`, `Branch`, `Commit`, `Diff`, `Merge`,\n\u003e and `WOQL` (v0.2 DSL — ~70 operators) are implemented and tested. GraphQL,\n\u003e Ecto, and ExDatalog integrations are planned for later milestones. See\n\u003e `ARCHITECTURE.md` and `AGENTS.md` for the roadmap.\n\n## Installation\n\nAdd `terminusdb_client` to your dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:terminusdb_client, \"~\u003e 0.3.1\"}\n  ]\nend\n```\n\nThen run `mix deps.get`.\n\n## Quick start\n\n```elixir\n# 1. Configure a connection (immutable context). Default auth is admin:root.\nconfig = TerminusDB.Config.new(endpoint: \"http://localhost:6363\")\n\n# 2. Create a database with a schema graph.\n{:ok, _} =\n  TerminusDB.Database.create(config, \"mydb\",\n    label: \"My Database\",\n    comment: \"A demo database\",\n    schema: true\n  )\n\n# 3. Scope the config to the database for document operations.\nconfig = TerminusDB.Config.with_database(config, \"mydb\")\n\n# 4. Insert a schema (a Class document in the schema graph).\n{:ok, _} =\n  TerminusDB.Document.insert(config,\n    %{\"@type\" =\u003e \"Class\", \"@id\" =\u003e \"Person\", \"name\" =\u003e \"xsd:string\", \"age\" =\u003e \"xsd:integer\"},\n    author: \"admin\", message: \"add Person schema\",\n    graph_type: :schema\n  )\n\n# 5. Insert a document (an instance of Person).\n{:ok, _} =\n  TerminusDB.Document.insert(config,\n    %{\"@type\" =\u003e \"Person\", \"name\" =\u003e \"Alice\", \"age\" =\u003e 30},\n    author: \"admin\", message: \"add Alice\"\n  )\n\n# 6. Retrieve documents by type.\n{:ok, docs} = TerminusDB.Document.get(config, type: \"Person\", as_list: true)\n# =\u003e [%{\"@id\" =\u003e \"Person/Alice\", \"name\" =\u003e \"Alice\", \"age\" =\u003e 30}]\n\n# 7. Query by template (match all Person documents with age 30).\n{:ok, matches} =\n  TerminusDB.Document.query(config, %{\"@type\" =\u003e \"Person\", \"age\" =\u003e 30})\n\n# 8. Retrieve the schema frame for the Person class.\n{:ok, frame} = TerminusDB.Schema.frame(config, \"Person\")\n# =\u003e %{\"@type\" =\u003e \"Class\", \"name\" =\u003e \"xsd:string\", \"age\" =\u003e \"xsd:integer\"}\n\n# 9. Create a branch and work on it.\n{:ok, _} = TerminusDB.Branch.create(config, \"feature\")\nfeature_config = TerminusDB.Config.with_branch(config, \"feature\")\n\n# 10. Stream large result sets without loading everything into memory.\nTerminusDB.Document.stream(config, type: \"Person\")\n|\u003e Stream.each(\u0026IO.inspect/1)\n|\u003e Stream.run()\n\n# 11. Clean up.\n{:ok, _} = TerminusDB.Document.delete(config, id: \"Person/Alice\", author: \"admin\", message: \"remove\")\n{:ok, _} = TerminusDB.Branch.delete(config, \"feature\")\n{:ok, _} = TerminusDB.Database.delete(config, \"mydb\")\n```\n\nAll public functions return `{:ok, result}` or `{:error, %TerminusDB.Error{}}`. Each\n`!/1`-suffixed variant raises `TerminusDB.Error` instead.\n\n## Authentication\n\nBasic auth (default `admin`/`root`) or a bearer token:\n\n```elixir\nconfig = TerminusDB.Config.new(endpoint: \"http://localhost:6363\", token: \"tok_abc\")\n```\n\n## Telemetry\n\nEvery operation emits `[:terminusdb, \u003carea\u003e, :start]` and `[:stop]` events\n(`\u003carea\u003e` is `:database`, `:document`, `:query`, `:branch`, `:merge`, `:diff`, or\n`:connection`). Attach with `:telemetry.attach_many/4`. See `TerminusDB.Telemetry`\nand ADR-0005.\n\n```elixir\n:telemetry.attach_many(\n  \"my-handler\",\n  [[:terminusdb, :database, :stop]],\n  fn _event, %{duration: duration}, meta, _ctx -\u003e\n    :telemetry.execute([:my_app, :db, :duration], %{duration: duration}, %{path: meta.path})\n  end,\n  nil\n)\n```\n\n## Development\n\n```bash\nmix deps.get\nmix test                 # hermetic unit + doctests\nmix coveralls            # coverage (target 80%, enforced via coveralls.json)\nmix quality              # format + credo + sobelow + dialyzer\nmix verify               # full quality gate + tests + docs\n```\n\nIntegration tests run against a Dockerized TerminusDB (the image has no in-container\nhealthcheck, so poll from the host):\n\n```bash\ndocker compose up -d\nuntil curl -sf http://localhost:6363/api/ok \u003e/dev/null 2\u003e\u00261; do sleep 1; done\nmix test --only integration\ndocker compose down\n```\n\nSee `AGENTS.md` for the full operating guide and `ARCHITECTURE.md` + `docs/adr/` for\nthe design.\n\n## License\nLicensed under the Apache License, Version 2.0.\nSee [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthanos%2Fterminusdb-client-elixir","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthanos%2Fterminusdb-client-elixir","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthanos%2Fterminusdb-client-elixir/lists"}