MCPcopy
hub / github.com/Masterminds/squirrel / TestSelectBuilderContextRunners

Function TestSelectBuilderContextRunners

select_ctx_test.go:11–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestSelectBuilderContextRunners(t *testing.T) {
12 db := &DBStub{}
13 b := Select("test").RunWith(db)
14
15 expectedSql := "SELECT test"
16
17 b.ExecContext(ctx)
18 assert.Equal(t, expectedSql, db.LastExecSql)
19
20 b.QueryContext(ctx)
21 assert.Equal(t, expectedSql, db.LastQuerySql)
22
23 b.QueryRowContext(ctx)
24 assert.Equal(t, expectedSql, db.LastQueryRowSql)
25
26 err := b.ScanContext(ctx)
27 assert.NoError(t, err)
28}
29
30func TestSelectBuilderContextNoRunner(t *testing.T) {
31 b := Select("test")

Callers

nothing calls this directly

Calls 6

SelectFunction · 0.85
ExecContextMethod · 0.65
QueryContextMethod · 0.65
QueryRowContextMethod · 0.65
RunWithMethod · 0.45
ScanContextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…