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

Method TestUpdateMultiValues

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

Source from the content-addressed store, hash-verified

430}
431
432func (s *StmtSuite) TestUpdateMultiValues(c *gc.C) {
433 stmt := table1.Update()
434 stmt.Set(table1Col1, Literal(1))
435 stmt.Set(table1Col2, Literal(2))
436 stmt.Where(EqL(table1Col2, 3))
437 sql, err := stmt.String("db")
438 c.Assert(err, gc.IsNil)
439
440 c.Assert(
441 sql,
442 gc.Equals,
443 "UPDATE `db`.`table1` "+
444 "SET `table1`.`col1`=1, `table1`.`col2`=2 "+
445 "WHERE `table1`.`col2`=3")
446}
447
448func (s *StmtSuite) TestUpdateWithOrderBy(c *gc.C) {
449 stmt := table1.Update().Set(table1Col1, Literal(1))

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected