MCPcopy Index your code
hub / github.com/Masterminds/squirrel / TestInsertBuilderContextRunners

Function TestInsertBuilderContextRunners

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

Source from the content-addressed store, hash-verified

9)
10
11func TestInsertBuilderContextRunners(t *testing.T) {
12 db := &DBStub{}
13 b := Insert("test").Values(1).RunWith(db)
14
15 expectedSql := "INSERT INTO test VALUES (?)"
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 TestInsertBuilderContextNoRunner(t *testing.T) {
31 b := Insert("test").Values(1)

Callers

nothing calls this directly

Calls 7

InsertFunction · 0.85
ValuesMethod · 0.80
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…