History fetching from server
This commit is contained in:
parent
9506b89453
commit
aeca9d8559
4 changed files with 149 additions and 65 deletions
20
node.go
20
node.go
|
|
@ -293,6 +293,26 @@ func RetrieveNodeHistory(userID int, nodeUUID string, offset int) (nodes []Node,
|
|||
}
|
||||
return
|
||||
} // }}}
|
||||
func RetrieveNodeHistoryCount(userID int, nodeUUID string) (count int, err error) { // {{{
|
||||
var row *sql.Row
|
||||
row = db.QueryRow(`
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM node_history
|
||||
WHERE
|
||||
user_id = $1 AND
|
||||
uuid = $2
|
||||
`,
|
||||
userID,
|
||||
nodeUUID,
|
||||
)
|
||||
if err = row.Scan(&count); err != nil {
|
||||
err = werr.Wrap(err)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
} // }}}
|
||||
func NodeCrumbs(nodeUUID string) (nodes []Node, err error) { // {{{
|
||||
var rows *sqlx.Rows
|
||||
rows, err = db.Queryx(`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue