MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / TestPlugin_RecordsQueriesOnQuery

Function TestPlugin_RecordsQueriesOnQuery

integrations/gorm/plugin_test.go:51–65  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

49}
50
51func TestPlugin_RecordsQueriesOnQuery(t *testing.T) {
52 db := openTestDB(t)
53 plugin := gosqlxgorm.NewPlugin()
54 if err := db.Use(plugin); err != nil {
55 t.Fatal(err)
56 }
57
58 var users []User
59 db.Find(&users)
60
61 stats := plugin.Stats()
62 if stats.TotalQueries == 0 {
63 t.Error("expected at least one recorded query")
64 }
65}
66
67func TestPlugin_RecordsTableName(t *testing.T) {
68 db := openTestDB(t)

Callers

nothing calls this directly

Calls 3

StatsMethod · 0.95
openTestDBFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected