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

Method TestSelectWhereDate

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

Source from the content-addressed store, hash-verified

57}
58
59func (s *StmtSuite) TestSelectWhereDate(c *gc.C) {
60 date := time.Date(1999, 1, 2, 3, 4, 5, 0, time.UTC)
61
62 q := table1.Select(table1Col1).Where(GtL(table1Col4, date))
63 sql, err := q.String("db")
64
65 c.Assert(err, gc.IsNil)
66 c.Assert(
67 sql,
68 gc.Equals,
69 "SELECT `table1`.`col1` FROM `db`.`table1` "+
70 "WHERE `table1`.`col4`>'1999-01-02 03:04:05.000000'")
71}
72
73func (s *StmtSuite) TestSelectAndWhere(c *gc.C) {
74 q := table1.Select(table1Col1).AndWhere(GtL(table1Col1, 123))

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected