{"id":15668289,"url":"https://github.com/devstopfix/ecto_uuid7","last_synced_at":"2025-10-18T12:10:23.548Z","repository":{"id":181595252,"uuid":"667021682","full_name":"devstopfix/ecto_uuid7","owner":"devstopfix","description":"UUID v7 for Ecto","archived":false,"fork":false,"pushed_at":"2023-07-16T11:44:45.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T23:37:55.313Z","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/devstopfix.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-16T11:34:35.000Z","updated_at":"2024-07-17T04:30:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0e15770-b9fc-4ae3-afad-2a343bfc6ed7","html_url":"https://github.com/devstopfix/ecto_uuid7","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"6e9f9b5da5174927920ec4311db67700307c1d69"},"previous_names":["devstopfix/ecto_uuid7"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/devstopfix/ecto_uuid7","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Fecto_uuid7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Fecto_uuid7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Fecto_uuid7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Fecto_uuid7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devstopfix","download_url":"https://codeload.github.com/devstopfix/ecto_uuid7/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devstopfix%2Fecto_uuid7/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278457485,"owners_count":25989955,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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":[],"created_at":"2024-10-03T14:07:54.844Z","updated_at":"2025-10-05T12:47:56.725Z","avatar_url":"https://github.com/devstopfix.png","language":"Elixir","readme":"# Ecto.UUID7\n\nAn Ecto type for UUID version 7 strings.\n\nVersion 7 identifiers are friendlier to you and to your database when used as\nprimary keys. Quoting an extension to [RFC4122][rfc]:\n\n\u003e UUID version 7 features a time-ordered value field derived from the widely \n\u003e implemented and well known Unix Epoch timestamp source, the number of \n\u003e milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded. \n\u003e As well as improved entropy characteristics over versions 1 or 6.\n\nVersion 4 identifiers utilize 122 bits of randomness (the other\n6 bits are used for versioning) causing records to spread uniformly across\nyour indexes. Being random they are also indistinguishable. Instead we use 74\nbits of randomness per millisecond with the higher bits being time and the \nlower bits being random.\n\nIn addition the identifiers can be parameterized per table to add a tag\ndocumenting the source of the identifier as described in the blog post\nfrom Stripe [designing APIs for humans][objectids].\n\nSee `Ecto.UUID7` for the options.\n\nExample UUIDs:\n\n| Version | Options                 | UUID                                   |\n| ------: | ----------------------- | -------------------------------------- |\n| 4       | n/a                     | `c52c41fb-da84-4bd9-9bc6-23ac53fa649d` |\n| 4       | n/a                     | `804647b2-6aac-4079-bb85-9bb3dd2b1031` |\n| 7       | `[]`                    | `01881b68-69c4-79ac-841d-3f5d3e532ff2` |\n| 7       | `[]`                    | `01881b68-69c4-7134-a6bc-97642e5b9a36` |\n| 7       | `tag: 0xD0C`            | `01881b74-f303-7d0c-84bc-7933009bfb33` |\n| 7       | `tag: 0xFEE`            | `01881b75-cbad-7fee-ad2b-485ad44d639a` |\n| 7       | `seq: true`             | `01881b77-b689-7939-8000-3b8290bf1f1b` |\n| 7       | `seq: true`             | `01881b77-b689-7a72-8004-2a2f17992a6c` |\n| 7       | `seq: true, tag: 0xE55` | `01881b7c-48a7-7e55-80cd-70a62c706a37` |\n| 7       | `seq: true, tag: 0xE55` | `01881b7c-48a8-7e55-80d3-c5365d794a63` |\n\n\n## Installation\n\nAdd to your dependencies:\n\n```elixir\n{:ecto_uuid7, \"~\u003e 1.0.0\"}\n```\n\nNote this uses the `Ecto` module name and namespace. If there is ever then\nthen we will rename the module and bump the minor version, or retire the\nlibrary if it's functionality is replaced.\n\n## Performance\n\nThis library delegates most of the work to the existing `Ecto.UUID` type\nwhich is highly optimized. The performance can be verified by running\nthe [soak test script](soak.exs) - instructions are inside the script.\n\n\n[objectids]: https://dev.to/stripe/designing-apis-for-humans-object-ids-3o5a\n[rfc]: https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format#name-uuid-version-7","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevstopfix%2Fecto_uuid7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevstopfix%2Fecto_uuid7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevstopfix%2Fecto_uuid7/lists"}