Your Question
Error for PostgreSQL inet format parsing
Since pgx migrate to v5 It doesn't provide pgtype.Inet anymore and suggest use netip.Prefix
replace it: https://github.com/jackc/pgx/issues/1470
but seems not work on gorm
My model
import (
"gorm.io/gorm"
"net/netip"
)
type Log struct {
ID uint `json:"id" gorm:"primarykey"`
ShopID uint `json:"shop_id" gorm:""`
RouterIP netip.Prefix `json:"router_ip" gorm:"type:inet"`
PublicIP netip.Prefix `json:"public_ip" gorm:"type:inet"`
}
As like #5606 I also got the same error, unless I change data type from netip.Prefix to string
sql: Scan error on column index 6, name "router_ip": unsupported Scan, storing driver.Value type string into type *netip.Prefix
[1.344ms] [rows:1] SELECT * FROM "log" WHERE "shop_id"."serial" IN ('1','2')
The document you expected this should be explained
tell user how to use this type at the document
Expected answer
add support or update https://github.com/go-gorm/datatypes support it?
Comment From: github-actions[bot]
This issue has been automatically marked as stale because it has been open 360 days with no activity. Remove stale label or comment or this will be closed in 180 days