History fetching from server

This commit is contained in:
Magnus Åhall 2026-06-06 20:21:11 +02:00
parent 9506b89453
commit aeca9d8559
4 changed files with 149 additions and 65 deletions

20
node.go
View file

@ -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(`