-
Notifications
You must be signed in to change notification settings - Fork 891
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
Migrate jackc/pgtype CIDR to its pgx/v5/pgtype alternative #1470
Comments
jackc/pgtype
CIDR to its pgx/v5/pgtype
alternativejackc/pgtype
CIDR
to its pgx/v5/pgtype
alternative
jackc/pgtype
CIDR
to its pgx/v5/pgtype
alternativejackc/pgtype CIDR
to its pgx/v5/pgtype
alternative
jackc/pgtype CIDR
to its pgx/v5/pgtype
alternativejackc/pgtype
CIDR to its pgx/v5/pgtype
alternative
jackc/pgtype
CIDR to its pgx/v5/pgtype
alternative
You should be able to use the core Go types directly now. There isn't a pgx CIDR type because it shouldn't be necessary anymore. You probably want https://pkg.go.dev/net/netip#Prefix. |
@jackc Thank you for your reply! I’ll try it out. May I ask just one more questing regarding pgtype V5 vs V4? I have the code that queries a I understand that it tries to umarshal the json and if I use |
Can you make an example program that demonstrates this? |
@jackc Sorry, I'm short on time at the moment to make a reproducible example. But here's the part of the code where the error is coming from (
If you could tell what might be wrong by looking at this snippet? Btw, thanks for all the excellent work with the library! |
@jackc I went down the source code and I see that Though I don't understand why double pointer is passed instead of a pointer. |
Fix it on the SQL-query level by casting json to varchar like so: |
@antonprokopovich Glad you got it working. I think the |
I'm trying to migrate from
pgx/v4
topgx/v5
and in particular I need to rewrite code that usesCIDR
type fromjackc/pgtype
to it's v5 alternative. I seev5/pgtype
has theInetCodec
type but I can't figure out how to use it instead of CIDR from v4.Here the code I need to rewrite:
Any kind of help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: