{"id":13508772,"url":"https://github.com/edubkendo/datomex","last_synced_at":"2025-04-15T06:31:54.701Z","repository":{"id":23648226,"uuid":"27018642","full_name":"edubkendo/datomex","owner":"edubkendo","description":"Elixir driver for the Datomic REST API","archived":false,"fork":false,"pushed_at":"2016-02-06T18:33:54.000Z","size":57,"stargazers_count":47,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:36:18.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/edubkendo.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":"2014-11-23T01:38:17.000Z","updated_at":"2023-12-13T17:54:09.000Z","dependencies_parsed_at":"2022-08-22T03:30:17.188Z","dependency_job_id":null,"html_url":"https://github.com/edubkendo/datomex","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/edubkendo%2Fdatomex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubkendo%2Fdatomex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubkendo%2Fdatomex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edubkendo%2Fdatomex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edubkendo","download_url":"https://codeload.github.com/edubkendo/datomex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799979,"owners_count":21163404,"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-01T02:00:58.205Z","updated_at":"2025-04-15T06:31:54.417Z","avatar_url":"https://github.com/edubkendo.png","language":"Elixir","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"readme":"Datomex\n=======\n\nLow level Elixir drivers for the [Datomic database](http://www.datomic.com/).\n\nAPI Docs at: http://hexdocs.pm/datomex\n\n## Install\n\nAdd Datomex and HTTPoison to your mix.exs dependencies:\n\n```elixir\ndef deps do\n[ {:datomex, \"~\u003e 0.0.1\"},\n  {:httpoison, \"~\u003e 0.8.0\" } ]\nend\n```\n\n## Usage\n\n```elixir\nDatomex.start_link \"localhost\", 8888, \"db\", \"test\"\n\nDatomex.databases\n# {:ok,\n#   %HTTPoison.Response{body: \"[\\\"test\\\"]\",\n#   headers: %{\"Content-Length\" =\u003e \"8\",\n#   \"Content-Type\" =\u003e \"application/edn;charset=UTF-8\",\n#   \"Date\" =\u003e \"Sun, 23 Nov 2014 08:44:59 GMT\",\n#   \"Server\" =\u003e \"Jetty(8.1.11.v20130520)\", \"Vary\" =\u003e \"Accept\"},\n#   status_code: 200}}\n\nDatomex.create_database(\"test_02\")\n# {:ok,\n#   %HTTPoison.Response{body: \"[\\\"test\\\" \\\"test_02\\\"]\",\n#   headers: %{\"Content-Length\" =\u003e \"18\",\n#     \"Content-Type\" =\u003e \"application/edn;charset=UTF-8\",\n#     \"Date\" =\u003e \"Sun, 23 Nov 2014 08:46:22 GMT\",\n#     \"Server\" =\u003e \"Jetty(8.1.11.v20130520)\", \"Vary\" =\u003e \"Accept\"},\n#   status_code: 201}}\n\nmovies = \"\"\"\n[\n  {:db/id #db/id[:db.part/db]\n  :db/ident :movie/title\n  :db/valueType :db.type/string\n  :db/cardinality :db.cardinality/one\n  :db/doc \"movie's title\"\n  :db.install/_attribute :db.part/db}\n  {:db/id #db/id[:db.part/db]\n  :db/ident :movie/rating\n  :db/valueType :db.type/double\n  :db/cardinality :db.cardinality/one\n  :db/doc \"movie's rating\"\n  :db.install/_attribute :db.part/db}\n]\n\"\"\"\nDatomex.transact movies\n# {:ok,\n#   %HTTPoison.Response{body: \"{:db-before {:basis-t 1119, :db/alias \\\"db/test\\\"}, :db-after {:basis-t 1120, :db/alias \\\"db/test\\\"}, :tx-data [{:e 13194139534432, :a 50, :v #inst \\\"2014-11-23T08:48:27.678-00:00\\\", :tx 13194139534432, :added true}], :tempids {-9223367638809264861 64, -9223367638809264860 63}}\",\n#   headers: %{\"Content-Length\" =\u003e \"272\",\n#     \"Content-Type\" =\u003e \"application/edn;charset=UTF-8\",\n#     \"Date\" =\u003e \"Sun, 23 Nov 2014 08:48:27 GMT\",\n#     \"Server\" =\u003e \"Jetty(8.1.11.v20130520)\", \"Vary\" =\u003e \"Accept\"},\n#   status_code: 201}}\n\nDatomex.datoms \"eavt\"\n# {:ok,\n# %HTTPoison.Response{body: \"[{:e 0, :a 10, :v :db.part/db, :tx 13194139533312, :added true}...\n\nDatomex.entity 1\n# {:ok,\n#   %HTTPoison.Response{body: \"{:db/ident :db/add, :db/doc \\\"Primitive assertion. All transactions eventually reduce to a collection of primitive assertions and retractions of facts, e.g. [:db/add fred :age 42].\\\", :db/id 1}\",\n#   headers: %{\"Content-Length\" =\u003e \"191\",\n#     \"Content-Type\" =\u003e \"application/edn;charset=UTF-8\",\n#     \"Date\" =\u003e \"Sun, 23 Nov 2014 08:51:32 GMT\",\n#     \"Server\" =\u003e \"Jetty(8.1.11.v20130520)\", \"Vary\" =\u003e \"Accept\"},\n#   status_code: 200}}\n\nDatomex.transact(~s([[:db/add #db/id [:db.part/user] :movie/title \"trainspotting\"]]))\n{:ok, %HTTPoison.Response{ body: body }} = Datomex.q(~s([:find ?m :where [?m :movie/title \"trainspotting\"]]))\nmovies = Exdn.to_elixir!(body)\n# [vector: [17592186045486], vector: [17592186045538], vector: [17592186045481],\n# vector: [17592186045483], vector: [17592186045478], vector: [17592186045509],\n# vector: [17592186045474], vector: [17592186045468], vector: [17592186045503],\n# vector: [17592186045466], vector: [17592186045472], vector: [17592186045499],\n# vector: [17592186045530], vector: [17592186045493], vector: [17592186045490],\n# vector: [17592186045524], vector: [17592186045521]]\n```\n\n## Related Projects\n\nThe [Exdn edn parser library](https://github.com/psfblair/exdn) \n([API docs](http://hexdocs.pm/exdn/2.1.1/api-reference.html)) may be used with\nDatomex, both to parse incoming edn and to generate edn strings from Elixir data\nstructures. Some examples of how this can be done may be found in the tests.\n\n## TODO\n- Add docs\n- Tighter integration with `exdn`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubkendo%2Fdatomex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedubkendo%2Fdatomex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedubkendo%2Fdatomex/lists"}