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

Method TestUpdateSingleValue

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

Source from the content-addressed store, hash-verified

406}
407
408func (s *StmtSuite) TestUpdateSingleValue(c *gc.C) {
409 stmt := table1.Update().Set(table1Col1, Literal(1))
410 stmt.Where(EqL(table1Col2, 2))
411 sql, err := stmt.String("db")
412 c.Assert(err, gc.IsNil)
413
414 c.Assert(
415 sql,
416 gc.Equals,
417 "UPDATE `db`.`table1` SET `table1`.`col1`=1 WHERE `table1`.`col2`=2")
418}
419
420func (s *StmtSuite) TestUpdateUsingDeferredLookupColumns(c *gc.C) {
421 stmt := table1.Update().Set(table1.C("col1"), Literal(1))

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected