This commit is contained in:
huangsimin 2018-12-10 17:21:28 +08:00
parent 1f42653b4c
commit 80d7a127d9

View File

@ -39,13 +39,13 @@ func TestSelect(t *testing.T) {
logdb := NewLogDB("logdb.yaml") logdb := NewLogDB("logdb.yaml")
logdb.Connect() logdb.Connect()
t.Error(logdb) t.Error(logdb)
rows := logdb.Select("select * from log_spider limit 10;") rows := logdb.Select("select uid, spider_id, device, platform, response from log_spider limit 10;")
log.Println(rows) log.Println(rows)
var l []ADStore var l []ADStore
for rows.Next() { for rows.Next() {
ad := ADStore{} ad := ADStore{}
rows.Scan(&ad) rows.Scan(&ad.uid, &ad.spider_id, &ad.device, &ad.platform, &ad.response)
l = append(l, ad) l = append(l, ad)
} }
log.Println(len(l)) log.Println(len(l))