MCPcopy
hub / github.com/go-gorm/gorm / TestQueryRaw

Function TestQueryRaw

tests/sql_builder_test.go:142–153  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

140}
141
142func TestQueryRaw(t *testing.T) {
143 users := []*User{
144 GetUser("row_query_user", Config{}),
145 GetUser("row_query_user", Config{}),
146 GetUser("row_query_user", Config{}),
147 }
148 DB.Create(&users)
149
150 var user User
151 DB.Raw("select * from users WHERE id = ?", users[1].ID).First(&user)
152 CheckUser(t, user, *users[1])
153}
154
155func TestDryRun(t *testing.T) {
156 user := *GetUser("dry-run", Config{})

Callers

nothing calls this directly

Calls 5

GetUserFunction · 0.85
CheckUserFunction · 0.85
CreateMethod · 0.65
FirstMethod · 0.65
RawMethod · 0.65

Tested by

no test coverage detected