MCPcopy
hub / github.com/dropbox/godropbox / TestSelectOnJoin

Method TestSelectOnJoin

database/sqlbuilder/statement_test.go:195–207  ·  view source on GitHub ↗
(c *gc.C)

Source from the content-addressed store, hash-verified

193}
194
195func (s *StmtSuite) TestSelectOnJoin(c *gc.C) {
196
197 join := table1.InnerJoinOn(table2, Eq(table1Col3, table2Col3))
198 sql, err := join.Select(table1Col1, table2Col4).String("db")
199
200 c.Assert(err, gc.IsNil)
201 c.Assert(
202 sql,
203 gc.Equals,
204 "SELECT `table1`.`col1`,`table2`.`col4` "+
205 "FROM `db`.`table1` JOIN `db`.`table2` "+
206 "ON `table1`.`col3`=`table2`.`col3`")
207}
208
209func (s *StmtSuite) TestSelectWithSharedLock(c *gc.C) {
210

Callers

nothing calls this directly

Calls 4

EqFunction · 0.85
InnerJoinOnMethod · 0.65
StringMethod · 0.65
SelectMethod · 0.65

Tested by

no test coverage detected