Siyuan Wang
Results
2
comments of
Siyuan Wang
You will get ` pq: syntax error at or near "{"` error when removed the quoted. ```go type ExampleModel struct { gorm.Model Data json.RawMessage `gorm:"not null;default:{}"` } ```
Interesting, I found another issue if I changed the insert value as: ```go testData := &ExampleModel{Data: ([]byte)(`{"key":"value"}`)} ``` It works when calling ` db.Save(testData)`: ```sql INSERT INTO "example_models" ("created_at","updated_at","deleted_at","data") VALUES...