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

Function TestSelectBuilderNestedSelectDollar

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

Source from the content-addressed store, hash-verified

210}
211
212func TestSelectBuilderNestedSelectDollar(t *testing.T) {
213 nestedBuilder := StatementBuilder.PlaceholderFormat(Dollar).Select("*").Prefix("NOT EXISTS (").
214 From("bar").Where("y = ?", 42).Suffix(")")
215 outerSql, _, err := StatementBuilder.PlaceholderFormat(Dollar).Select("*").
216 From("foo").Where("x = ?").Where(nestedBuilder).ToSql()
217
218 assert.NoError(t, err)
219 assert.Equal(t, "SELECT * FROM foo WHERE x = $1 AND NOT EXISTS ( SELECT * FROM bar WHERE y = $2 )", outerSql)
220}
221
222func TestSelectBuilderMustSql(t *testing.T) {
223 defer func() {

Callers

nothing calls this directly

Calls 7

ToSqlMethod · 0.65
SuffixMethod · 0.45
WhereMethod · 0.45
FromMethod · 0.45
PrefixMethod · 0.45
SelectMethod · 0.45
PlaceholderFormatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…