MCPcopy Index your code
hub / github.com/dropbox/godropbox / TestLeftJoin

Method TestLeftJoin

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

Source from the content-addressed store, hash-verified

110}
111
112func (s *TableSuite) TestLeftJoin(c *gc.C) {
113 join := table1.LeftJoinOn(table2, Eq(table1Col3, table2Col3))
114
115 buf := &bytes.Buffer{}
116
117 err := join.SerializeSql("db", buf)
118 c.Assert(err, gc.IsNil)
119
120 sql := buf.String()
121 c.Assert(
122 sql,
123 gc.Equals,
124 "`db`.`table1` LEFT JOIN `db`.`table2` "+
125 "ON `table1`.`col3`=`table2`.`col3`")
126}
127
128func (s *TableSuite) TestRightJoin(c *gc.C) {
129 join := table1.RightJoinOn(table2, Eq(table1Col3, table2Col3))

Callers

nothing calls this directly

Calls 4

EqFunction · 0.85
LeftJoinOnMethod · 0.65
SerializeSqlMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected