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

Function TestUpdateBuilderPlaceholders

update_test.go:59–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestUpdateBuilderPlaceholders(t *testing.T) {
60 b := Update("test").SetMap(Eq{"x": 1, "y": 2})
61
62 sql, _, _ := b.PlaceholderFormat(Question).ToSql()
63 assert.Equal(t, "UPDATE test SET x = ?, y = ?", sql)
64
65 sql, _, _ = b.PlaceholderFormat(Dollar).ToSql()
66 assert.Equal(t, "UPDATE test SET x = $1, y = $2", sql)
67}
68
69func TestUpdateBuilderRunners(t *testing.T) {
70 db := &DBStub{}

Callers

nothing calls this directly

Calls 4

UpdateFunction · 0.85
ToSqlMethod · 0.65
SetMapMethod · 0.45
PlaceholderFormatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…