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

Feature Request: Add network address support for Postgresql #719

Closed
KeenS opened this Issue Feb 17, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@KeenS
Contributor

KeenS commented Feb 17, 2017

Hi, diesel developers.
I'm using diesel at work and need to handle network addresses for better functionalities of our product.
You know PostgreSQL supports network address types. CF PostgreSQL: Documentation: 9.6: Network Address Types.
Is it possible to support network address types on diesel? It doesn't seem MySQL and SQLite support it, so it will be a Pg only feature.

As it seems there aren't address range types neither in rust std nor crates.io, you may need to define enums such as:

use std::net::{Ipv4Addr,IpV6Addr}
enum Inet {
  Ipv4(Ipv4Addr, [u8; 4]),
  Ipv6(Ipvv6Addr, [u8; 16]),
}

MacAddress exits in crates.io CF https://docs.rs/eui48/0.1.0/eui48/struct.MacAddress.html .

@KeenS

This comment has been minimized.

Contributor

KeenS commented Feb 17, 2017

Er.. subnetmask can be represented in u8, no need to have the same bits as addresses.

@Eijebong

This comment has been minimized.

Member

Eijebong commented Aug 9, 2017

I think everything has been implemented now :)

Feel free to reopen if we missed something

@Eijebong Eijebong closed this Aug 9, 2017

@KeenS

This comment has been minimized.

Contributor

KeenS commented Aug 9, 2017

No problem at all. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment