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