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

Function TestSelectBuilderParamJoin

select_test.go:161–173  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

159}
160
161func TestSelectBuilderParamJoin(t *testing.T) {
162
163 expectedSql := "SELECT * FROM bar JOIN baz ON bar.foo = baz.foo AND baz.foo = ?"
164 expectedArgs := []interface{}{42}
165
166 b := Select("*").From("bar").Join("baz ON bar.foo = baz.foo AND baz.foo = ?", 42)
167
168 sql, args, err := b.ToSql()
169 assert.NoError(t, err)
170
171 assert.Equal(t, expectedSql, sql)
172 assert.Equal(t, args, expectedArgs)
173}
174
175func TestSelectBuilderNestedSelectJoin(t *testing.T) {
176

Callers

nothing calls this directly

Calls 4

SelectFunction · 0.85
JoinMethod · 0.80
ToSqlMethod · 0.65
FromMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…