MCPcopy Create free account
hub / github.com/go-pg/pg / TestQueryNestedStructs

Method TestQueryNestedStructs

loader_test.go:72–80  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

70}
71
72func (t *LoaderTest) TestQueryNestedStructs(c *C) {
73 src := &multipleLoader{}
74 src.One.Num = 1
75 src.Num = 2
76 dst := &multipleLoader{}
77 _, err := t.db.QueryOne(dst, `SELECT ?one__num AS one__num, ?num as num`, src)
78 c.Assert(err, IsNil)
79 c.Assert(dst, DeepEquals, src)
80}
81
82func (t *LoaderTest) TestQueryStmt(c *C) {
83 stmt, err := t.db.Prepare("SELECT 1 AS num")

Callers

nothing calls this directly

Calls 2

AssertMethod · 0.80
QueryOneMethod · 0.65

Tested by

no test coverage detected