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

Method TestUpdateWithLimit

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

Source from the content-addressed store, hash-verified

462}
463
464func (s *StmtSuite) TestUpdateWithLimit(c *gc.C) {
465 stmt := table1.Update().Set(table1Col1, Literal(1))
466 stmt.Where(EqL(table1Col2, 2))
467 stmt.Limit(5)
468 sql, err := stmt.String("db")
469 c.Assert(err, gc.IsNil)
470
471 c.Assert(
472 sql,
473 gc.Equals,
474 "UPDATE `db`.`table1` "+
475 "SET `table1`.`col1`=1 "+
476 "WHERE `table1`.`col2`=2 "+
477 "LIMIT 5")
478}
479
480//
481// DELETE statement tests =====================================================

Callers

nothing calls this directly

Calls 7

LiteralFunction · 0.85
EqLFunction · 0.85
SetMethod · 0.65
UpdateMethod · 0.65
WhereMethod · 0.65
LimitMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected