mirror of
https://github.com/idanoo/go-mastodon-stats
synced 2025-07-01 22:02:20 +00:00
Testing
This commit is contained in:
parent
adfcf44890
commit
6b6037f735
2 changed files with 24 additions and 10 deletions
|
@ -3,6 +3,7 @@ package gomastodonstats
|
|||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
@ -57,3 +58,23 @@ func runIntQuery(schema string, q string) (int, error) {
|
|||
|
||||
return res, err
|
||||
}
|
||||
|
||||
func runIntQueryWithTime(schema string, q string, t time.Time) (int, error) {
|
||||
var res int
|
||||
db, err := getConnection(schema)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
|
||||
rows, err := db.Query(q, t)
|
||||
if err != nil {
|
||||
return res, err
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
for rows.Next() {
|
||||
rows.Scan(&res)
|
||||
}
|
||||
|
||||
return res, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue