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

Method TestSelectWithSharedLock

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

Source from the content-addressed store, hash-verified

207}
208
209func (s *StmtSuite) TestSelectWithSharedLock(c *gc.C) {
210
211 q := table1.Select(table1Col1).Where(GtL(table1Col1, 123)).WithSharedLock()
212 sql, err := q.String("db")
213
214 c.Assert(err, gc.IsNil)
215 c.Assert(
216 sql,
217 gc.Equals,
218 "SELECT `table1`.`col1` FROM `db`.`table1` "+
219 "WHERE `table1`.`col1`>123 LOCK IN SHARE MODE")
220}
221
222func (s *StmtSuite) TestSelectDistinct(c *gc.C) {
223 q := table1.Select(table1Col1).Distinct()

Callers

nothing calls this directly

Calls 5

GtLFunction · 0.85
WithSharedLockMethod · 0.65
WhereMethod · 0.65
SelectMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected