{"id":13508855,"url":"https://github.com/Frost/isn","last_synced_at":"2025-03-30T11:32:53.156Z","repository":{"id":31557485,"uuid":"35122196","full_name":"Frost/isn","owner":"Frost","description":"Postgrex.Extension and Ecto.Type for PostgreSQL isn module","archived":false,"fork":false,"pushed_at":"2024-04-11T14:45:23.000Z","size":144,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-11T17:15:54.711Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Frost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2015-05-05T20:27:02.000Z","updated_at":"2024-04-15T12:03:19.781Z","dependencies_parsed_at":"2023-11-24T23:22:42.576Z","dependency_job_id":"f2c31c53-ac0f-4352-a509-a58a4fd1f4b9","html_url":"https://github.com/Frost/isn","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/Frost%2Fisn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frost%2Fisn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frost%2Fisn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Frost%2Fisn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Frost","download_url":"https://codeload.github.com/Frost/isn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246314012,"owners_count":20757454,"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-08-01T02:00:59.478Z","updated_at":"2025-03-30T11:32:52.765Z","avatar_url":"https://github.com/Frost.png","language":"Elixir","funding_links":[],"categories":["ORM and Datamapping"],"sub_categories":[],"readme":"# ISN\n\n[![Build Status][4]][5]\n\nISN adds a [`Postgrex.Extension`][1] and [`Ecto.Type`][2] definitions\nfor the datatypes defined in the [`isn`][3] PostgreSQL module.\n\n## Usage\n\n### Ecto migrations\n\n```elixir\ndefmodule MyApp.Repo.Migrations.CreateBook do\n  use Ecto.Migration\n\n  def change do\n    create table(:books) do\n      add :isbn, :isbn13\n      # other fields\n    end\n  end\nend\n```\n\n### Ecto Models\n\n```elixir\ndefmodule MyApp.Book do\n  use MyApp.Web, :model\n\n  schema \"books\" do\n    field :isbn, ISN.ISBN13, read_after_writes: true\n    # other fields\n  end\nend\n```\n\n## Installation\n\n**Add the package to your Mixfile**\n\n```elixir\ndefp deps do\n  [{:isn, \"~\u003e 3.0\"}]\nend\n```\n\n**Add the isn extension to your database**\n\n    mix do isn.gen.migration, ecto.migrate\n\n**Add a lib/postgrex_types.ex file with the following content:**\n```elixir\nPostgrex.Types.define(MyApp.PostgrexTypes, [ISN], [])\n```\n\n**Add the following lines in config.exs:**\n```elixir\nconfig :my_app, MyApp.Repo,\n  types: MyApp.PostgrexTypes\n```\n\n## Defined types\n\n`ISN` adds the following ecto and corresponding postgrex types:\n\nEcto.Type    | Postgrex type\n-------------|--------------\n`ISN.ISBN`   | `:isbn`\n`ISN.ISBN13` | `:isbn13`\n`ISN.ISMN`   | `:ismn`\n`ISN.ISMN13` | `:ismn13`\n`ISN.ISSN`   | `:issn`\n`ISN.ISSN13` | `:issn13`\n`ISN.EAN13`  | `:ean13`\n`ISN.UPC`    | `:upc`\n\n[1]: http://hexdocs.pm/postgrex/Postgrex.Extension.html\n[2]: http://hexdocs.pm/ecto/Ecto.Type.html\n[3]: http://www.postgresql.org/docs/9.4/static/isn.html\n[4]: https://semaphoreci.com/api/v1/projects/be7c4c34-c49e-45c7-9320-3fcc4f7f476a/458429/badge.svg\n[5]: https://semaphoreci.com/frost/isn\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFrost%2Fisn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFrost%2Fisn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFrost%2Fisn/lists"}