···
-
func GetPulls(e Execer, filters ...filter) ([]*Pull, error) {
pulls := make(map[int]*Pull)
···
whereClause = " where " + strings.Join(conditions, " and ")
···
rows, err := e.Query(query, args...)
···
inClause := strings.TrimSuffix(strings.Repeat("?, ", len(pulls)), ", ")
submissionsQuery := fmt.Sprintf(`
-
id, pull_id, round_number, patch, source_rev
···
for submissionsRows.Next() {
var sourceRev sql.NullString
err := submissionsRows.Scan(
s.SourceRev = sourceRev.String
···
return orderedByPullId, nil
func GetPull(e Execer, repoAt syntax.ATURI, pullId int) (*Pull, error) {
···
+
func GetPullsWithLimit(e Execer, limit int, filters ...filter) ([]*Pull, error) {
pulls := make(map[int]*Pull)
···
whereClause = " where " + strings.Join(conditions, " and ")
+
limitClause = fmt.Sprintf(" limit %d ", limit)
···
+
`, whereClause, limitClause)
rows, err := e.Query(query, args...)
···
inClause := strings.TrimSuffix(strings.Repeat("?, ", len(pulls)), ", ")
submissionsQuery := fmt.Sprintf(`
+
id, pull_id, round_number, patch, created, source_rev
···
for submissionsRows.Next() {
var sourceRev sql.NullString
err := submissionsRows.Scan(
+
createdTime, err := time.Parse(time.RFC3339, createdAt)
+
s.Created = createdTime
s.SourceRev = sourceRev.String
···
return orderedByPullId, nil
+
func GetPulls(e Execer, filters ...filter) ([]*Pull, error) {
+
return GetPullsWithLimit(e, 0, filters...)
func GetPull(e Execer, repoAt syntax.ATURI, pullId int) (*Pull, error) {