Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ToSql impl for IpAddr #430

Closed
cholcombe973 opened this issue Apr 3, 2019 · 3 comments
Closed

ToSql impl for IpAddr #430

cholcombe973 opened this issue Apr 3, 2019 · 3 comments

Comments

@cholcombe973
Copy link

cholcombe973 commented Apr 3, 2019

postgres has support for the inet type that can handle ipv4 and ipv6. It would be nice if the postgres crate suported a ToSql for IpAddr. It's likely more efficient than using varchar

@sfackler
Copy link
Owner

sfackler commented Apr 3, 2019

I assume ToSql would set /32 as the netmask? Should FromSql ignore it or assert that it's /32?

@cholcombe973
Copy link
Author

That's a good question. IpAddr's variants don't seem to have that information. I think assuming /32 is fine

@cholcombe973
Copy link
Author

cholcombe973 commented Apr 4, 2019 via email

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

No branches or pull requests

2 participants