2
0

Add pgx.Oid serialization

This commit is contained in:
Jack Christensen
2014-08-08 10:51:54 -05:00
parent 4d4a45fc34
commit 0ddf94ef9d
4 changed files with 52 additions and 1 deletions
+2
View File
@@ -332,6 +332,7 @@ func TestQueryRowCoreTypes(t *testing.T) {
f64 float64
b bool
t time.Time
oid pgx.Oid
}
var actual, zero allTypes
@@ -352,6 +353,7 @@ func TestQueryRowCoreTypes(t *testing.T) {
{"select $1::timestamptz", []interface{}{time.Unix(123, 5000)}, []interface{}{&actual.t}, allTypes{t: time.Unix(123, 5000)}},
{"select $1::timestamp", []interface{}{time.Date(2010, 1, 2, 3, 4, 5, 0, time.Local)}, []interface{}{&actual.t}, allTypes{t: time.Date(2010, 1, 2, 3, 4, 5, 0, time.Local)}},
{"select $1::date", []interface{}{time.Date(1987, 1, 2, 0, 0, 0, 0, time.Local)}, []interface{}{&actual.t}, allTypes{t: time.Date(1987, 1, 2, 0, 0, 0, 0, time.Local)}},
{"select $1::oid", []interface{}{pgx.Oid(42)}, []interface{}{&actual.oid}, allTypes{oid: 42}},
}
for i, tt := range tests {