{"id":17134334,"url":"https://github.com/brianium/entity","last_synced_at":"2025-07-26T15:09:12.592Z","repository":{"id":57713287,"uuid":"101101423","full_name":"brianium/entity","owner":"brianium","description":"A simple starting point for Clojure(Script) entities","archived":false,"fork":false,"pushed_at":"2017-08-24T15:51:13.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T05:56:26.706Z","etag":null,"topics":["clojure","clojurescript","entity","uuid"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","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/brianium.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-08-22T19:48:39.000Z","updated_at":"2021-02-08T04:14:51.000Z","dependencies_parsed_at":"2022-09-05T22:50:22.252Z","dependency_job_id":null,"html_url":"https://github.com/brianium/entity","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fentity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fentity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fentity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianium%2Fentity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianium","download_url":"https://codeload.github.com/brianium/entity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245217945,"owners_count":20579300,"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":["clojure","clojurescript","entity","uuid"],"created_at":"2024-10-14T19:44:38.863Z","updated_at":"2025-03-24T06:16:31.579Z","avatar_url":"https://github.com/brianium.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# entity\n\n[![Clojars Project](https://img.shields.io/clojars/v/brianium/entity.svg)](https://clojars.org/brianium/entity)\n\nJust a basic entity library for Clojure(Script). Helps you deal with maps that have ids\n\n## Usage\n\nThis library only deals with entities having uuid ids (for now). It provides the `brianium.entity` namespace for creating uuids and entities with them in a way that works with both Clojure and ClojureScript.\n\n```clojure\n(require '[brianium.entity :refer :all])\n\n(def uuid-str \"e5aedf45-cf9c-4488-897e-8462fcaacd94\")\n\n(uuid-string? uuid-str)\n;; =\u003e true\n\n(string-\u003euuid uuid-str)\n;; =\u003e #uuid \"e5aedf45-cf9c-4488-897e-8462fcaacd94\"\n\n(make-uuid)\n;; =\u003e #uuid \"3ef75e99-66ca-415d-92c2-85b96c38b038\"\n\n(make-entity {:name \"brian\" :title \"computer\"})\n;; =\u003e {:brianium.entity/id #uuid \"3ef75e99-66ca-415d-92c2-85b96c38b038\"\n       :name \"brian\"\n\t   :title \"computer}\n```\n\nThere is also a general purpose `EntityStorage` protocol defined in `brianium.entity.storage`\n\n```clojure\n(defprotocol EntityStorage\n  (-get-by-id [this id])\n  (-insert [this entity])\n  (-update [this entity])\n  (-all [this])\n  (-remove [this id]))\n```\n\nThere are functions for each protocol method available as well:\n\n```clojure\n(require '[brianium.entity.storage :as store])\n\n;; there is a set backed implementation useful for testing\n(require '[brianium.entity.storage.set :refer [make-storage]])\n\n(def storage (make-storage))\n\n(store/insert storage some-entity)\n(store/get-by-id storage some-uuid)\n\n;; there is also a useful function built on the others\n(store/insert-or-update storage some-entity)\n```\n\n## Specs\n\nThere are specs for all public functions and types - including `EntityStorage`\n\nSpecs for entities can be found in `brianium.entity.spec` and specs for storage can be found in `brianium.entity.storage.spec`\n\nGenerators for entities and storage can be found at `brianium.entity.generators` and `brianium.entity.storage.generators`.\n\n## Testing\n\nTests are a combination of unit tests and generative tests a-la `clojure/test.check`\n\n```\n$ lein test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Fentity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianium%2Fentity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianium%2Fentity/lists"}