Skip to content

Conversation

@aj-foster
Copy link
Collaborator

This PR adds an Ecto type for conveniently casting and storing IP addresses. It also installs sobelow and adds a mix check alias.

@aj-foster aj-foster requested review from a team as code owners August 9, 2025 03:04
Copy link
Contributor

@PragTob PragTob left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, but I'd like to see an argument why we choose to implement our own over using ecto_network instead.

Otherwise looks good according to my understanding (other than us not specifying :inet as type) - since we're recommending to store it as :inet I'd love a test showcasing storing and retrieving it successfully from such a column - but I can also see how people would think that's overkill.


@doc false
@impl Ecto.Type
def type, do: :string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never done this, but why are we specifying :string here instead of :inet?

It should also be possible, we might also consider instead using INET from ecto_network

@aj-foster
Copy link
Collaborator Author

Nevermind, just use EctoNetwork.INET.

@aj-foster aj-foster closed this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants