-
-
Notifications
You must be signed in to change notification settings - Fork 339
Open
Description
GORM Playground Link
Description
func TestName(t *testing.T) {
test_res.PreparePG()
query_im.SetDefault(kk_pg.GormClient)
err := query_im.TestModel.Debug().
Create(&orm_im.TestModel{Status: orm_im.TestModelUnknown})
info, err := query_im.TestModel.Debug().
Select(query_im.TestModel.Status).// Comment out this line to make Debug() work
Where(query_im.TestModel.Status.Eq(orm_im.TestModelUnknown)).
Updates(orm_im.TestModel{Status: orm_im.TestModelStored})
if err != nil {
t.Error(err)
}
t.Log(info.RowsAffected)
}
=== RUN TestName
2025/08/17 14:05:26 logger.go:187: /Users/cruvie/cruvie-space/code-hub/my-project/ss/ss_go/service_base/models/im/query_im/gen_test.go:20
[5.009ms] [rows:1] INSERT INTO "ss"."test_model" ("status") VALUES (0)
gen_test.go:28: 0
--- PASS: TestName (0.02s)
PASS
gorm.io/gen v0.3.27
gorm.io/gorm v1.30.1
go 1.25
pg 17
Metadata
Metadata
Assignees
Labels
No labels