{"id":17188232,"url":"https://github.com/jclem/base62_uuid_field","last_synced_at":"2025-03-25T04:39:46.609Z","repository":{"id":57479407,"uuid":"161666819","full_name":"jclem/base62_uuid_field","owner":"jclem","description":"An Ecto type for Base62-encoded binary UUIDs","archived":false,"fork":false,"pushed_at":"2022-02-16T19:07:25.000Z","size":26,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:52:51.301Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/base62_uuid_field","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/jclem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-13T16:36:36.000Z","updated_at":"2022-02-16T19:07:26.000Z","dependencies_parsed_at":"2022-09-18T06:04:27.644Z","dependency_job_id":null,"html_url":"https://github.com/jclem/base62_uuid_field","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fbase62_uuid_field","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fbase62_uuid_field/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fbase62_uuid_field/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jclem%2Fbase62_uuid_field/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jclem","download_url":"https://codeload.github.com/jclem/base62_uuid_field/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245401374,"owners_count":20609163,"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-10-15T01:08:27.668Z","updated_at":"2025-03-25T04:39:46.583Z","avatar_url":"https://github.com/jclem.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Base62UUIDField [![Coverage Status](https://coveralls.io/repos/github/jclem/base62_uuid_field/badge.svg?branch=master\u0026bump=1)](https://coveralls.io/github/jclem/base62_uuid_field?branch=master)\n\nAn [Ecto.Type](https://hexdocs.pm/ecto/Ecto.Type.html) for Base62-encoded UUIDs.\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `base62_uuid_field` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:base62_uuid_field, \"~\u003e 1.0.0\"}\n  ]\nend\n```\n\n## Usage\n\nThis Ecto type builds on top of the existing `Ecto.UUID` type, except that it ensures that the types at runtime are represented as [Base62-encoded UUIDs](https://github.com/jclem/base62_uuid).\n\nFor example, given an `identity_users` table with a `:binary_id` primary key:\n\n```elixir\ncreate table(:identity_users, primary_key: false) do\n  add :id, :binary_id, primary_key: true\nend\n```\n\nWe can have Base62-encoded primary keys at runtime instead of much longer and less URL-friendly hexadecimal-encoded UUIDs.\n\n```elixir\ndefmodule App.Identity.User do\n  use Ecto.Schema\n\n  @primary_key {:id, Base62UUIDField, autogenerate: true}\n\n  # ...etc.\nend\n```\n\n```elixir\niex\u003e %App.Identity.User{} |\u003e App.Identity.User.changeset(%{}) |\u003e App.Repo.insert!()\n%App.Identity.User{\n  __meta__: #Ecto.Schema.Metadata\u003c:loaded, \"identity_users\"\u003e,\n  id: \"6UupZ56JriyqxwjYXR9Aiz\",\n  inserted_at: ~N[2018-12-13 18:22:57],\n  updated_at: ~N[2018-12-13 18:22:57]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fbase62_uuid_field","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjclem%2Fbase62_uuid_field","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjclem%2Fbase62_uuid_field/lists"}