We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go-gorm/playground#786
Since (if I understand correctly) GORM uses pgx, I should be able to use netip.Addr since it's supported by the former.
pgx
netip.Addr
However, model with netip.Addr field fails migration.
The text was updated successfully, but these errors were encountered:
My mistake: I have to set type as gorm:"type:inet", not gorm:"inet". Closing.
gorm:"type:inet"
gorm:"inet"
Sorry, something went wrong.
Update: it still does not work, neither with or without the type:inet tag.
type:inet
unsupported type netip.Addr, a struct
2025/01/25 16:23:29 playground/main_test.go:15 sql: converting argument $10 type: unsupported type netip.Addr, a struct [0.194ms] [rows:0] INSERT INTO `users` (`created_at`,`updated_at`,`deleted_at`,`name`,`age`,`birthday`,`company_id`,`manager_id`,`active`,`net_addr`) VALUES ("2025-01-25 16:23:29.548","2025-01-25 16:23:29.548",NULL,"jinzhu",0,NULL,NULL,NULL,false,"1.2.3.4") RETURNING `id`
jinzhu
No branches or pull requests
GORM Playground Link
go-gorm/playground#786
Description
Since (if I understand correctly) GORM uses
pgx
, I should be able to usenetip.Addr
since it's supported by the former.However, model with
netip.Addr
field fails migration.The text was updated successfully, but these errors were encountered: