1213
This commit is contained in:
parent
1f42653b4c
commit
80d7a127d9
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user