{"id":23414391,"url":"https://github.com/benstepp/ecto_ksuid","last_synced_at":"2025-04-12T05:45:13.349Z","repository":{"id":59190222,"uuid":"534766346","full_name":"benstepp/ecto_ksuid","owner":"benstepp","description":"Custom type for Ecto to support ksuids","archived":false,"fork":false,"pushed_at":"2024-09-26T23:37:29.000Z","size":128,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T05:45:03.895Z","etag":null,"topics":["ecto","ecto-types","ksuid","unique-id","uuid"],"latest_commit_sha":null,"homepage":"https://hexdocs.pm/ecto_ksuid","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/benstepp.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":"2022-09-09T18:45:21.000Z","updated_at":"2024-09-26T23:36:29.000Z","dependencies_parsed_at":"2022-09-13T01:52:33.646Z","dependency_job_id":null,"html_url":"https://github.com/benstepp/ecto_ksuid","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/benstepp%2Fecto_ksuid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benstepp%2Fecto_ksuid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benstepp%2Fecto_ksuid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/benstepp%2Fecto_ksuid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/benstepp","download_url":"https://codeload.github.com/benstepp/ecto_ksuid/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525154,"owners_count":21118616,"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","ecto-types","ksuid","unique-id","uuid"],"created_at":"2024-12-22T19:58:44.386Z","updated_at":"2025-04-12T05:45:13.317Z","avatar_url":"https://github.com/benstepp.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ecto_ksuid\n\n[![Build Status](https://github.com/benstepp/ecto_ksuid/actions/workflows/ci.yml/badge.svg)](https://github.com/benstepp/ecto_ksuid/actions)\n[![Hex.pm Version](https://img.shields.io/hexpm/v/ecto_ksuid 'hex.pm')](https://hex.pm/ecto_ksuid)\n[![Hexdocs](https://img.shields.io/badge/Docs-hexdocs-green 'hexdocs.pm')](https://hexdocs.pm/ecto_ksuid)\n[![Downloads](https://img.shields.io/hexpm/dt/ecto_ksuid)](https://hex.pm/ecto_ksuid)\n[![License MIT](https://img.shields.io/badge/license-MIT-green 'License MIT')](https://github.com/benstepp/ecto_ksuid/blob/main/LICENSE)\n\n`EctoKsuid` allows seamless usage of\n[ksuids](https://github.com/segmentio/ksuid) with `:ecto` in your application.\nTo get a better idea of what ksuids are, and how they came to be I highly\nrecommend reading [A breif History of the\nUUID](https://segment.com/blog/a-brief-history-of-the-uuid/)\n\n\u003e [Ksuid] borrows core ideas from the ubiquitous UUID standard, adding time-based\n\u003e ordering and more friendly representation formats.\n\nAdditionally, `EctoKsuid` allows easy addition of a `:prefix` to the ksuid\nthat are available at runtime. This generates developer friendly ids much like\nstripe's object prefixed ids in your elixir application.\n\n#### Example Ksuids using the `\"user_\"` prefix\n\n- `\"user_2EgT2R97RRNXWXdA3Ov6znVLDCd\"`\n- `\"user_2EgT5YAJ1EMj86IdI8In8Cmfsnj\"`\n- `\"user_2EgT6WuSzOmcF9bZaRdS3X6lEaL\"`\n- `\"user_2EgT7SEl7LaIGIHIQ1gIjB9eVwT\"`\n- `\"user_2EgT8B20KvdsIQznKX6Tuh2RGDe\"`\n\n## Documentation\n\nDocumentation can be found online on [HexDocs](https://hexdocs.pm/ecto_ksuid).\n\n## Installation\n\n1. Add `:ecto_ksuid` to your list of dependencies in `mix.exs`\n\n   ```elixir\n   def deps do\n     [\n       # ...\n       {:ecto_ksuid, \"~\u003e 0.3.0\"}\n     ]\n   end\n   ```\n\n2. Install using mix.\n\n   ```bash\n   mix deps.get\n   ```\n\n## Basic Usage\n\n`EctoKsuid` is just a custom `Ecto.ParameterizedType` and can be used in your\napplication just like any other Ecto type.\n\n1. Add columns to your database\n\n   ```elixir\n   defmodule MyApp.Repo.Migrations.AddPublicIdToUsers do\n     use Ecto.Migration\n\n     def change do\n       alter table(:users) do\n         add :public_id, EctoKsuid.column()\n       end\n     end\n   end\n   ```\n\n2. Add fields to your schema\n\n   ```elixir\n   defmodule MyApp.User do\n     use Ecto.Schema\n\n     schema \"users\" do\n       # ...\n       field :public_id, EctoKsuid\n     end\n   end\n   ```\n\n## Guides\n\nFor more details on how to use this library, check out the guides:\n\n- [Using Ksuid as the Default](using_ksuid_as_default.md)\n- [Configuring Prefix](configuring_prefix.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenstepp%2Fecto_ksuid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenstepp%2Fecto_ksuid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenstepp%2Fecto_ksuid/lists"}