MCPcopy Create free account
hub / github.com/dropbox/godropbox / TestNestedRightJoin

Method TestNestedRightJoin

database/sqlbuilder/table_test.go:193–209  ·  view source on GitHub ↗
(c *gc.C)

Source from the content-addressed store, hash-verified

191}
192
193func (s *TableSuite) TestNestedRightJoin(c *gc.C) {
194 join1 := table1.InnerJoinOn(table2, Eq(table1Col3, table2Col3))
195 join2 := join1.RightJoinOn(table3, Eq(table1Col1, table3Col1))
196
197 buf := &bytes.Buffer{}
198
199 err := join2.SerializeSql("db", buf)
200 c.Assert(err, gc.IsNil)
201
202 sql := buf.String()
203 c.Assert(
204 sql,
205 gc.Equals,
206 "`db`.`table1` "+
207 "JOIN `db`.`table2` ON `table1`.`col3`=`table2`.`col3` "+
208 "RIGHT JOIN `db`.`table3` ON `table1`.`col1`=`table3`.`col1`")
209}

Callers

nothing calls this directly

Calls 5

EqFunction · 0.85
InnerJoinOnMethod · 0.65
RightJoinOnMethod · 0.65
SerializeSqlMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected