File count on storage page
This commit is contained in:
parent
6df2be7944
commit
65f8cd14a7
8 changed files with 319 additions and 16 deletions
5
file.go
5
file.go
|
|
@ -124,6 +124,11 @@ func FileWriteData(userID int, dbID int, data []byte, create bool) (err error) {
|
|||
return
|
||||
} // }}}
|
||||
|
||||
func FileCountForUser(userID int) (count int, err error) { // {{{
|
||||
row := db.QueryRowx(`SELECT COUNT(*) FROM public.file WHERE user_id = $1`, userID)
|
||||
err = row.Scan(&count)
|
||||
return
|
||||
} // }}}
|
||||
func FileMetadata(userID int, uuid string) (f File, err error) { // {{{
|
||||
row := db.QueryRowx(`SELECT * FROM public.file WHERE user_id = $1 AND "uuid" = $2`, userID, uuid)
|
||||
err = row.StructScan(&f)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue