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

Method TestInsertMultipleRows

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

Source from the content-addressed store, hash-verified

314}
315
316func (s *StmtSuite) TestInsertMultipleRows(c *gc.C) {
317 stmt := table1.Insert(table1Col1, table1Col2)
318 stmt.Add(Literal(1), Literal(2))
319 stmt.Add(Literal(11), Literal(22))
320 stmt.Add(Literal(111), Literal(222))
321
322 sql, err := stmt.String("db")
323 c.Assert(err, gc.IsNil)
324
325 c.Assert(
326 sql,
327 gc.Equals,
328 "INSERT INTO `db`.`table1` "+
329 "(`table1`.`col1`,`table1`.`col2`) "+
330 "VALUES (1,2), (11,22), (111,222)")
331}
332
333func (s *StmtSuite) TestOnDuplicateKeyUpdateNilCol(c *gc.C) {
334 stmt := table1.Insert(table1Col1, table1Col2)

Callers

nothing calls this directly

Calls 4

LiteralFunction · 0.85
InsertMethod · 0.65
AddMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected