Monorepo for Tangled tangled.org

appview/db: update query functions for repo_did across all tables #1139

deleted opened by oyster.cafe targeting master from oyster.cafe/tangled-core: master
Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:3fwecdnvtcscjnrx2p4n7alz/sh.tangled.repo.pull/3mgprvt2emh22
+3 -13
Interdiff #3 #4
appview/db/artifact.go

This file has not been changed.

appview/db/collaborators.go

This file has not been changed.

appview/db/issues.go

This file has not been changed.

appview/db/language.go

This file has not been changed.

appview/db/pipeline.go

This file has not been changed.

appview/db/profile.go

This file has not been changed.

appview/db/pulls.go

This file has not been changed.

appview/db/reference.go

This file has not been changed.

appview/db/repos.go

This file has not been changed.

+2 -12
appview/db/star.go
··· 72 72 return err 73 73 } 74 74 75 - func GetStarCount(e Execer, subjectAt syntax.ATURI) (int, error) { 76 - stars := 0 77 - err := e.QueryRow( 78 - `select count(did) from stars where subject_at = ?`, subjectAt).Scan(&stars) 79 - if err != nil { 80 - return 0, err 81 - } 82 - return stars, nil 83 - } 84 - 85 - func GetStarCountByRepoDid(e Execer, repoDid string, repoAt syntax.ATURI) (int, error) { 75 + func GetStarCount(e Execer, repoDid string, subjectAt syntax.ATURI) (int, error) { 86 76 stars := 0 87 77 err := e.QueryRow( 88 78 `select count(did) from stars where subject_did = ? or subject_at = ?`, 89 - repoDid, repoAt.String()).Scan(&stars) 79 + repoDid, subjectAt.String()).Scan(&stars) 90 80 if err != nil { 91 81 return 0, err 92 82 }
appview/db/webhooks.go

This file has not been changed.

+1 -1
appview/strings/strings.go
··· 149 149 showRendered = r.URL.Query().Get("code") != "true" 150 150 } 151 151 152 - starCount, err := db.GetStarCount(s.Db, string.AtUri()) 152 + starCount, err := db.GetStarCount(s.Db, "", string.AtUri()) 153 153 if err != nil { 154 154 l.Error("failed to get star count", "err", err) 155 155 }

History

9 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
This pull has been deleted (possibly by jj abandon or jj squash)
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments
1 commit
expand
appview/db: update query functions for repo_did across all tables
expand 0 comments