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

Support ipnet along with ipnetwork #2150

Open
Razican opened this issue Oct 13, 2022 · 0 comments · May be fixed by #3710
Open

Support ipnet along with ipnetwork #2150

Razican opened this issue Oct 13, 2022 · 0 comments · May be fixed by #3710
Labels
enhancement New feature or request

Comments

@Razican
Copy link
Contributor

Razican commented Oct 13, 2022

Is your feature request related to a problem? Please describe.
Not a problem per se, but ipnet has some advantages over ipnetwork (qoted from the discussion for the addition into diesel):

Diesel currently supports the ipnetwork crate for working with IP addresses and subnets in CIDR block notation. I'd like to propose an additional feature, allowing consumers to use the ipnet as well. The second crate presents a different API, such as facilities for managing subnetworks and traits for bitwise operations on addresses. ipnet is also significantly more popular than ipnetwork, though that may be a secondary concern.

From a compatibility point of view, ipnetwork is still under 1.0, which makes updates more time consuming, and new sqlx versions need to be published every time ipnetwork updates. ipnet should be an almost-direct port, since most (if not all) of the code for ipnetwork works for ipnet, just by changing the IpNetwork types to IpNet types. Also, both features should be able to work at the same time without any major issue.

Describe the solution you'd like
I would like to have a new ipnet feature, that uses the ipnet crate instead of the ipnetwork crate for handling PostgreSQL network types. The ipnetwork feature should still be available for those wanting to use this crate.

Additional context
The ipnet crate was recently added to diesel as an alternative for handling network types for PostgreSQL. It would be nice to have it in sqlx as well, and should be fairly straightforward to implement by borrowing code from the ipnetwork implementation.

@Razican Razican added the enhancement New feature or request label Oct 13, 2022
BeauGieskens added a commit to APNIC-net/sqlx that referenced this issue Jan 27, 2025
@BeauGieskens BeauGieskens linked a pull request Jan 27, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant