{"id":16732535,"url":"https://github.com/martinthenth/uuidv7","last_synced_at":"2025-05-16T09:06:24.200Z","repository":{"id":176720782,"uuid":"657272067","full_name":"martinthenth/uuidv7","owner":"martinthenth","description":"UUID v7 implementation and Ecto.Type for Elixir","archived":false,"fork":false,"pushed_at":"2025-04-18T02:10:50.000Z","size":782,"stargazers_count":103,"open_issues_count":5,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-09T09:47:37.796Z","etag":null,"topics":["ecto","elixir","uuid","uuid7","uuidv7"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/uuidv7","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/martinthenth.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-22T17:36:16.000Z","updated_at":"2025-04-30T15:54:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3ab4a6f-eab3-4b9d-954b-eabc7eceb93f","html_url":"https://github.com/martinthenth/uuidv7","commit_stats":null,"previous_names":["martinthenth/uuidv7"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinthenth%2Fuuidv7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinthenth%2Fuuidv7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinthenth%2Fuuidv7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinthenth%2Fuuidv7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinthenth","download_url":"https://codeload.github.com/martinthenth/uuidv7/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501558,"owners_count":22081528,"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":["ecto","elixir","uuid","uuid7","uuidv7"],"created_at":"2024-10-12T23:45:26.544Z","updated_at":"2025-05-16T09:06:19.191Z","avatar_url":"https://github.com/martinthenth.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UUIDv7\n\n[![CI](https://github.com/martinthenth/uuidv7/actions/workflows/elixir.yml/badge.svg)](https://github.com/martinthenth/uuidv7/actions/workflows/elixir.yml)\n[![Hex.pm](https://img.shields.io/hexpm/v/uuidv7)](https://hex.pm/packages/uuidv7)\n[![Hex.pm](https://img.shields.io/hexpm/dt/uuidv7)](https://hex.pm/packages/uuidv7)\n[![Hex.pm](https://img.shields.io/hexpm/l/uuidv7)](https://github.com/martinthenth/uuidv7/blob/main/LICENSE)\n\nA UUID v7 implementation and `Ecto.Type` for Elixir.\n\nThe RFC for the version 7 UUID: [RFC 9562](https://datatracker.ietf.org/doc/rfc9562/).\n\nThis library includes an `Ecto.Type` to (auto-)generate version 7 UUIDs in `Ecto.Schema` and beyond.\n\n## Installation\n\nThe package can be installed by adding `uuidv7` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [{:uuidv7, \"~\u003e 1.0\"}]\nend\n```\n\n## Usage\n\nIn your database schema, change primary key attribute from `:binary_id` to `UUIDv7`:\n\n```elixir\ndef App.Schemas.User do\n  @primary_key {:id, UUIDv7, autogenerate: true}\nend\n```\n\n## Benchmark\n\nRun `mix deps.get` and then `mix run scripts/bench.exs` to run the benchmark on your computer.\n\n```zsh\nOperating System: macOS\nCPU Information: Apple M2 Pro\nNumber of Available Cores: 10\nAvailable memory: 16 GB\nElixir 1.17.2\nErlang 27.0.1\nJIT enabled: true\n\nBenchmark suite executing with the following configuration:\nwarmup: 5 s\ntime: 10 s\nmemory time: 5 s\nreduction time: 0 ns\nparallel: 1\ninputs: none specified\nEstimated total run time: 1 min\n\nName                     ips        average  deviation         median         99th %\nuuidv7                1.82 M      550.49 ns ±15102.40%         417 ns        1291 ns\nuniq (uuid v7)        1.80 M      554.54 ns ±19362.74%         417 ns        1292 ns\necto (uuid v4)        1.72 M      579.75 ns ±12640.39%         458 ns        1208 ns\n\nComparison:\nuuidv7                1.82 M\nuniq (uuid v7)        1.80 M - 1.01x slower +4.05 ns\necto (uuid v4)        1.72 M - 1.05x slower +29.25 ns\n\nMemory usage statistics:\n\nName                   average  deviation         median         99th %\nuuidv7                237.99 B     ±2.23%          240 B          240 B\nuniq (uuid v7)        214.01 B     ±2.47%          216 B          216 B\necto (uuid v4)        214.01 B     ±2.47%          216 B          216 B\n\nComparison:\nuuidv7                   240 B\nuniq (uuid v7)        214.01 B - 0.90x memory usage -23.98508 B\necto (uuid v4)        214.01 B - 0.90x memory usage -23.98596 B\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinthenth%2Fuuidv7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinthenth%2Fuuidv7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinthenth%2Fuuidv7/lists"}