tenseleyflow/shithub / 6136b0a

Browse files

repos/sqlc: paginated + visibility-filtered repo listing queries

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
6136b0a0ade89349422e5356ea3d66e300aca78a
Parents
03b66e3
Tree
b5c6eab

3 changed files

StatusFile+-
M internal/repos/queries/repos.sql 82 0
M internal/repos/sqlc/querier.go 17 0
M internal/repos/sqlc/repos.sql.go 330 0
internal/repos/queries/repos.sqlmodified
@@ -89,6 +89,46 @@ ORDER BY updated_at DESC;
8989
 SELECT count(*) FROM repos
9090
 WHERE owner_user_id = $1 AND deleted_at IS NULL;
9191
 
92
+-- name: ListReposForOwnerUserPaged :many
93
+-- Paginated mirror of ListReposForOwnerUser. Used by the REST surface
94
+-- where the caller is the owner (or a site admin) and is allowed to see
95
+-- private repos. Order matches the un-paginated form so callers can
96
+-- swap between them without observing a reshuffle.
97
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
98
+       default_branch, is_archived, archived_at, deleted_at,
99
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
100
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
101
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
102
+       star_count, watcher_count, fork_count, init_status,
103
+       last_indexed_oid
104
+FROM repos
105
+WHERE owner_user_id = $1 AND deleted_at IS NULL
106
+ORDER BY updated_at DESC
107
+LIMIT $2 OFFSET $3;
108
+
109
+-- name: ListPublicReposForOwnerUser :many
110
+-- Public-only view of a user's repos for the "list another user's repos"
111
+-- REST endpoint. Hidden behind the same updated_at ordering.
112
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
113
+       default_branch, is_archived, archived_at, deleted_at,
114
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
115
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
116
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
117
+       star_count, watcher_count, fork_count, init_status,
118
+       last_indexed_oid
119
+FROM repos
120
+WHERE owner_user_id = $1
121
+  AND visibility = 'public'
122
+  AND deleted_at IS NULL
123
+ORDER BY updated_at DESC
124
+LIMIT $2 OFFSET $3;
125
+
126
+-- name: CountPublicReposForOwnerUser :one
127
+SELECT count(*) FROM repos
128
+WHERE owner_user_id = $1
129
+  AND visibility = 'public'
130
+  AND deleted_at IS NULL;
131
+
92132
 -- name: GetRepoByOwnerOrgAndName :one
93133
 -- S30: org-owner mirror of GetRepoByOwnerUserAndName. The (owner_org_id,
94134
 -- name) partial unique index from 0017 backs this lookup with the same
@@ -134,6 +174,48 @@ FROM repos
134174
 WHERE owner_org_id = $1 AND deleted_at IS NULL
135175
 ORDER BY updated_at DESC;
136176
 
177
+-- name: ListReposForOwnerOrgPaged :many
178
+-- Paginated mirror of ListReposForOwnerOrg for the REST list endpoint
179
+-- when the viewer is an org member and may see private repos.
180
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
181
+       default_branch, is_archived, archived_at, deleted_at,
182
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
183
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
184
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
185
+       star_count, watcher_count, fork_count, init_status,
186
+       last_indexed_oid
187
+FROM repos
188
+WHERE owner_org_id = $1 AND deleted_at IS NULL
189
+ORDER BY updated_at DESC
190
+LIMIT $2 OFFSET $3;
191
+
192
+-- name: CountReposForOwnerOrg :one
193
+SELECT count(*) FROM repos
194
+WHERE owner_org_id = $1 AND deleted_at IS NULL;
195
+
196
+-- name: ListPublicReposForOwnerOrg :many
197
+-- Public-only org repo listing for non-member callers (and the no-auth
198
+-- public-discovery REST view).
199
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
200
+       default_branch, is_archived, archived_at, deleted_at,
201
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
202
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
203
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
204
+       star_count, watcher_count, fork_count, init_status,
205
+       last_indexed_oid
206
+FROM repos
207
+WHERE owner_org_id = $1
208
+  AND visibility = 'public'
209
+  AND deleted_at IS NULL
210
+ORDER BY updated_at DESC
211
+LIMIT $2 OFFSET $3;
212
+
213
+-- name: CountPublicReposForOwnerOrg :one
214
+SELECT count(*) FROM repos
215
+WHERE owner_org_id = $1
216
+  AND visibility = 'public'
217
+  AND deleted_at IS NULL;
218
+
137219
 -- name: ListProfilePinCandidateReposForUser :many
138220
 SELECT sqlc.embed(r), COALESCE(owner_user.username, owner_org.slug)::text AS owner_slug
139221
 FROM repos r
internal/repos/sqlc/querier.gomodified
@@ -20,11 +20,14 @@ type Querier interface {
2020
 	ArchiveRepo(ctx context.Context, db DBTX, id int64) error
2121
 	CancelTransferRequest(ctx context.Context, db DBTX, id int64) error
2222
 	CountForksOfRepo(ctx context.Context, db DBTX, forkOfRepoID pgtype.Int8) (int64, error)
23
+	CountPublicReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error)
24
+	CountPublicReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error)
2325
 	// ─── rename rate limit support ─────────────────────────────────────────
2426
 	// Used to enforce the 5-per-30-days rename rate limit. The redirect
2527
 	// row is the audit trail for renames; counting them per repo gives a
2628
 	// reliable cap.
2729
 	CountRecentRedirectsForRepo(ctx context.Context, db DBTX, repoID int64) (int32, error)
30
+	CountReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error)
2831
 	CountReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error)
2932
 	// ─── S27 forks ─────────────────────────────────────────────────────
3033
 	// Insert a fork shell. Distinct from CreateRepo because forks set
@@ -97,6 +100,12 @@ type Querier interface {
97100
 	ListProfilePinCandidateReposForUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) ([]ListProfilePinCandidateReposForUserRow, error)
98101
 	ListProfilePinsForSet(ctx context.Context, db DBTX, setID int64) ([]ListProfilePinsForSetRow, error)
99102
 	ListPublicContributionRepos(ctx context.Context, db DBTX, limit int32) ([]ListPublicContributionReposRow, error)
103
+	// Public-only org repo listing for non-member callers (and the no-auth
104
+	// public-discovery REST view).
105
+	ListPublicReposForOwnerOrg(ctx context.Context, db DBTX, arg ListPublicReposForOwnerOrgParams) ([]Repo, error)
106
+	// Public-only view of a user's repos for the "list another user's repos"
107
+	// REST endpoint. Hidden behind the same updated_at ordering.
108
+	ListPublicReposForOwnerUser(ctx context.Context, db DBTX, arg ListPublicReposForOwnerUserParams) ([]Repo, error)
100109
 	// ─── soft-delete sweep query ───────────────────────────────────────────
101110
 	// The repo:hard_delete enqueuer queries this to find rows ready for
102111
 	// destruction. The 7-day grace is hard-coded here; if we add a config
@@ -105,7 +114,15 @@ type Querier interface {
105114
 	// ─── repo_topics (S32) ─────────────────────────────────────────────
106115
 	ListRepoTopics(ctx context.Context, db DBTX, repoID int64) ([]string, error)
107116
 	ListReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) ([]Repo, error)
117
+	// Paginated mirror of ListReposForOwnerOrg for the REST list endpoint
118
+	// when the viewer is an org member and may see private repos.
119
+	ListReposForOwnerOrgPaged(ctx context.Context, db DBTX, arg ListReposForOwnerOrgPagedParams) ([]Repo, error)
108120
 	ListReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) ([]Repo, error)
121
+	// Paginated mirror of ListReposForOwnerUser. Used by the REST surface
122
+	// where the caller is the owner (or a site admin) and is allowed to see
123
+	// private repos. Order matches the un-paginated form so callers can
124
+	// swap between them without observing a reshuffle.
125
+	ListReposForOwnerUserPaged(ctx context.Context, db DBTX, arg ListReposForOwnerUserPagedParams) ([]Repo, error)
109126
 	// S28 code-search reconciler: returns repos whose default_branch_oid
110127
 	// has advanced past last_indexed_oid (or last_indexed_oid is NULL
111128
 	// and a default exists). Limited so a single tick of the cron
internal/repos/sqlc/repos.sql.gomodified
@@ -36,6 +36,46 @@ func (q *Queries) CountForksOfRepo(ctx context.Context, db DBTX, forkOfRepoID pg
3636
 	return count, err
3737
 }
3838
 
39
+const countPublicReposForOwnerOrg = `-- name: CountPublicReposForOwnerOrg :one
40
+SELECT count(*) FROM repos
41
+WHERE owner_org_id = $1
42
+  AND visibility = 'public'
43
+  AND deleted_at IS NULL
44
+`
45
+
46
+func (q *Queries) CountPublicReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error) {
47
+	row := db.QueryRow(ctx, countPublicReposForOwnerOrg, ownerOrgID)
48
+	var count int64
49
+	err := row.Scan(&count)
50
+	return count, err
51
+}
52
+
53
+const countPublicReposForOwnerUser = `-- name: CountPublicReposForOwnerUser :one
54
+SELECT count(*) FROM repos
55
+WHERE owner_user_id = $1
56
+  AND visibility = 'public'
57
+  AND deleted_at IS NULL
58
+`
59
+
60
+func (q *Queries) CountPublicReposForOwnerUser(ctx context.Context, db DBTX, ownerUserID pgtype.Int8) (int64, error) {
61
+	row := db.QueryRow(ctx, countPublicReposForOwnerUser, ownerUserID)
62
+	var count int64
63
+	err := row.Scan(&count)
64
+	return count, err
65
+}
66
+
67
+const countReposForOwnerOrg = `-- name: CountReposForOwnerOrg :one
68
+SELECT count(*) FROM repos
69
+WHERE owner_org_id = $1 AND deleted_at IS NULL
70
+`
71
+
72
+func (q *Queries) CountReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID pgtype.Int8) (int64, error) {
73
+	row := db.QueryRow(ctx, countReposForOwnerOrg, ownerOrgID)
74
+	var count int64
75
+	err := row.Scan(&count)
76
+	return count, err
77
+}
78
+
3979
 const countReposForOwnerUser = `-- name: CountReposForOwnerUser :one
4080
 SELECT count(*) FROM repos
4181
 WHERE owner_user_id = $1 AND deleted_at IS NULL
@@ -918,6 +958,152 @@ func (q *Queries) ListPublicContributionRepos(ctx context.Context, db DBTX, limi
918958
 	return items, nil
919959
 }
920960
 
961
+const listPublicReposForOwnerOrg = `-- name: ListPublicReposForOwnerOrg :many
962
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
963
+       default_branch, is_archived, archived_at, deleted_at,
964
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
965
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
966
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
967
+       star_count, watcher_count, fork_count, init_status,
968
+       last_indexed_oid
969
+FROM repos
970
+WHERE owner_org_id = $1
971
+  AND visibility = 'public'
972
+  AND deleted_at IS NULL
973
+ORDER BY updated_at DESC
974
+LIMIT $2 OFFSET $3
975
+`
976
+
977
+type ListPublicReposForOwnerOrgParams struct {
978
+	OwnerOrgID pgtype.Int8
979
+	Limit      int32
980
+	Offset     int32
981
+}
982
+
983
+// Public-only org repo listing for non-member callers (and the no-auth
984
+// public-discovery REST view).
985
+func (q *Queries) ListPublicReposForOwnerOrg(ctx context.Context, db DBTX, arg ListPublicReposForOwnerOrgParams) ([]Repo, error) {
986
+	rows, err := db.Query(ctx, listPublicReposForOwnerOrg, arg.OwnerOrgID, arg.Limit, arg.Offset)
987
+	if err != nil {
988
+		return nil, err
989
+	}
990
+	defer rows.Close()
991
+	items := []Repo{}
992
+	for rows.Next() {
993
+		var i Repo
994
+		if err := rows.Scan(
995
+			&i.ID,
996
+			&i.OwnerUserID,
997
+			&i.OwnerOrgID,
998
+			&i.Name,
999
+			&i.Description,
1000
+			&i.Visibility,
1001
+			&i.DefaultBranch,
1002
+			&i.IsArchived,
1003
+			&i.ArchivedAt,
1004
+			&i.DeletedAt,
1005
+			&i.DiskUsedBytes,
1006
+			&i.ForkOfRepoID,
1007
+			&i.LicenseKey,
1008
+			&i.PrimaryLanguage,
1009
+			&i.HasIssues,
1010
+			&i.HasPulls,
1011
+			&i.CreatedAt,
1012
+			&i.UpdatedAt,
1013
+			&i.DefaultBranchOid,
1014
+			&i.AllowSquashMerge,
1015
+			&i.AllowRebaseMerge,
1016
+			&i.AllowMergeCommit,
1017
+			&i.DefaultMergeMethod,
1018
+			&i.StarCount,
1019
+			&i.WatcherCount,
1020
+			&i.ForkCount,
1021
+			&i.InitStatus,
1022
+			&i.LastIndexedOid,
1023
+		); err != nil {
1024
+			return nil, err
1025
+		}
1026
+		items = append(items, i)
1027
+	}
1028
+	if err := rows.Err(); err != nil {
1029
+		return nil, err
1030
+	}
1031
+	return items, nil
1032
+}
1033
+
1034
+const listPublicReposForOwnerUser = `-- name: ListPublicReposForOwnerUser :many
1035
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
1036
+       default_branch, is_archived, archived_at, deleted_at,
1037
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
1038
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
1039
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
1040
+       star_count, watcher_count, fork_count, init_status,
1041
+       last_indexed_oid
1042
+FROM repos
1043
+WHERE owner_user_id = $1
1044
+  AND visibility = 'public'
1045
+  AND deleted_at IS NULL
1046
+ORDER BY updated_at DESC
1047
+LIMIT $2 OFFSET $3
1048
+`
1049
+
1050
+type ListPublicReposForOwnerUserParams struct {
1051
+	OwnerUserID pgtype.Int8
1052
+	Limit       int32
1053
+	Offset      int32
1054
+}
1055
+
1056
+// Public-only view of a user's repos for the "list another user's repos"
1057
+// REST endpoint. Hidden behind the same updated_at ordering.
1058
+func (q *Queries) ListPublicReposForOwnerUser(ctx context.Context, db DBTX, arg ListPublicReposForOwnerUserParams) ([]Repo, error) {
1059
+	rows, err := db.Query(ctx, listPublicReposForOwnerUser, arg.OwnerUserID, arg.Limit, arg.Offset)
1060
+	if err != nil {
1061
+		return nil, err
1062
+	}
1063
+	defer rows.Close()
1064
+	items := []Repo{}
1065
+	for rows.Next() {
1066
+		var i Repo
1067
+		if err := rows.Scan(
1068
+			&i.ID,
1069
+			&i.OwnerUserID,
1070
+			&i.OwnerOrgID,
1071
+			&i.Name,
1072
+			&i.Description,
1073
+			&i.Visibility,
1074
+			&i.DefaultBranch,
1075
+			&i.IsArchived,
1076
+			&i.ArchivedAt,
1077
+			&i.DeletedAt,
1078
+			&i.DiskUsedBytes,
1079
+			&i.ForkOfRepoID,
1080
+			&i.LicenseKey,
1081
+			&i.PrimaryLanguage,
1082
+			&i.HasIssues,
1083
+			&i.HasPulls,
1084
+			&i.CreatedAt,
1085
+			&i.UpdatedAt,
1086
+			&i.DefaultBranchOid,
1087
+			&i.AllowSquashMerge,
1088
+			&i.AllowRebaseMerge,
1089
+			&i.AllowMergeCommit,
1090
+			&i.DefaultMergeMethod,
1091
+			&i.StarCount,
1092
+			&i.WatcherCount,
1093
+			&i.ForkCount,
1094
+			&i.InitStatus,
1095
+			&i.LastIndexedOid,
1096
+		); err != nil {
1097
+			return nil, err
1098
+		}
1099
+		items = append(items, i)
1100
+	}
1101
+	if err := rows.Err(); err != nil {
1102
+		return nil, err
1103
+	}
1104
+	return items, nil
1105
+}
1106
+
9211107
 const listRepoTopics = `-- name: ListRepoTopics :many
9221108
 
9231109
 SELECT topic FROM repo_topics WHERE repo_id = $1 ORDER BY topic ASC
@@ -1006,6 +1192,77 @@ func (q *Queries) ListReposForOwnerOrg(ctx context.Context, db DBTX, ownerOrgID
10061192
 	return items, nil
10071193
 }
10081194
 
1195
+const listReposForOwnerOrgPaged = `-- name: ListReposForOwnerOrgPaged :many
1196
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
1197
+       default_branch, is_archived, archived_at, deleted_at,
1198
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
1199
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
1200
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
1201
+       star_count, watcher_count, fork_count, init_status,
1202
+       last_indexed_oid
1203
+FROM repos
1204
+WHERE owner_org_id = $1 AND deleted_at IS NULL
1205
+ORDER BY updated_at DESC
1206
+LIMIT $2 OFFSET $3
1207
+`
1208
+
1209
+type ListReposForOwnerOrgPagedParams struct {
1210
+	OwnerOrgID pgtype.Int8
1211
+	Limit      int32
1212
+	Offset     int32
1213
+}
1214
+
1215
+// Paginated mirror of ListReposForOwnerOrg for the REST list endpoint
1216
+// when the viewer is an org member and may see private repos.
1217
+func (q *Queries) ListReposForOwnerOrgPaged(ctx context.Context, db DBTX, arg ListReposForOwnerOrgPagedParams) ([]Repo, error) {
1218
+	rows, err := db.Query(ctx, listReposForOwnerOrgPaged, arg.OwnerOrgID, arg.Limit, arg.Offset)
1219
+	if err != nil {
1220
+		return nil, err
1221
+	}
1222
+	defer rows.Close()
1223
+	items := []Repo{}
1224
+	for rows.Next() {
1225
+		var i Repo
1226
+		if err := rows.Scan(
1227
+			&i.ID,
1228
+			&i.OwnerUserID,
1229
+			&i.OwnerOrgID,
1230
+			&i.Name,
1231
+			&i.Description,
1232
+			&i.Visibility,
1233
+			&i.DefaultBranch,
1234
+			&i.IsArchived,
1235
+			&i.ArchivedAt,
1236
+			&i.DeletedAt,
1237
+			&i.DiskUsedBytes,
1238
+			&i.ForkOfRepoID,
1239
+			&i.LicenseKey,
1240
+			&i.PrimaryLanguage,
1241
+			&i.HasIssues,
1242
+			&i.HasPulls,
1243
+			&i.CreatedAt,
1244
+			&i.UpdatedAt,
1245
+			&i.DefaultBranchOid,
1246
+			&i.AllowSquashMerge,
1247
+			&i.AllowRebaseMerge,
1248
+			&i.AllowMergeCommit,
1249
+			&i.DefaultMergeMethod,
1250
+			&i.StarCount,
1251
+			&i.WatcherCount,
1252
+			&i.ForkCount,
1253
+			&i.InitStatus,
1254
+			&i.LastIndexedOid,
1255
+		); err != nil {
1256
+			return nil, err
1257
+		}
1258
+		items = append(items, i)
1259
+	}
1260
+	if err := rows.Err(); err != nil {
1261
+		return nil, err
1262
+	}
1263
+	return items, nil
1264
+}
1265
+
10091266
 const listReposForOwnerUser = `-- name: ListReposForOwnerUser :many
10101267
 SELECT id, owner_user_id, owner_org_id, name, description, visibility,
10111268
        default_branch, is_archived, archived_at, deleted_at,
@@ -1068,6 +1325,79 @@ func (q *Queries) ListReposForOwnerUser(ctx context.Context, db DBTX, ownerUserI
10681325
 	return items, nil
10691326
 }
10701327
 
1328
+const listReposForOwnerUserPaged = `-- name: ListReposForOwnerUserPaged :many
1329
+SELECT id, owner_user_id, owner_org_id, name, description, visibility,
1330
+       default_branch, is_archived, archived_at, deleted_at,
1331
+       disk_used_bytes, fork_of_repo_id, license_key, primary_language,
1332
+       has_issues, has_pulls, created_at, updated_at, default_branch_oid,
1333
+       allow_squash_merge, allow_rebase_merge, allow_merge_commit, default_merge_method,
1334
+       star_count, watcher_count, fork_count, init_status,
1335
+       last_indexed_oid
1336
+FROM repos
1337
+WHERE owner_user_id = $1 AND deleted_at IS NULL
1338
+ORDER BY updated_at DESC
1339
+LIMIT $2 OFFSET $3
1340
+`
1341
+
1342
+type ListReposForOwnerUserPagedParams struct {
1343
+	OwnerUserID pgtype.Int8
1344
+	Limit       int32
1345
+	Offset      int32
1346
+}
1347
+
1348
+// Paginated mirror of ListReposForOwnerUser. Used by the REST surface
1349
+// where the caller is the owner (or a site admin) and is allowed to see
1350
+// private repos. Order matches the un-paginated form so callers can
1351
+// swap between them without observing a reshuffle.
1352
+func (q *Queries) ListReposForOwnerUserPaged(ctx context.Context, db DBTX, arg ListReposForOwnerUserPagedParams) ([]Repo, error) {
1353
+	rows, err := db.Query(ctx, listReposForOwnerUserPaged, arg.OwnerUserID, arg.Limit, arg.Offset)
1354
+	if err != nil {
1355
+		return nil, err
1356
+	}
1357
+	defer rows.Close()
1358
+	items := []Repo{}
1359
+	for rows.Next() {
1360
+		var i Repo
1361
+		if err := rows.Scan(
1362
+			&i.ID,
1363
+			&i.OwnerUserID,
1364
+			&i.OwnerOrgID,
1365
+			&i.Name,
1366
+			&i.Description,
1367
+			&i.Visibility,
1368
+			&i.DefaultBranch,
1369
+			&i.IsArchived,
1370
+			&i.ArchivedAt,
1371
+			&i.DeletedAt,
1372
+			&i.DiskUsedBytes,
1373
+			&i.ForkOfRepoID,
1374
+			&i.LicenseKey,
1375
+			&i.PrimaryLanguage,
1376
+			&i.HasIssues,
1377
+			&i.HasPulls,
1378
+			&i.CreatedAt,
1379
+			&i.UpdatedAt,
1380
+			&i.DefaultBranchOid,
1381
+			&i.AllowSquashMerge,
1382
+			&i.AllowRebaseMerge,
1383
+			&i.AllowMergeCommit,
1384
+			&i.DefaultMergeMethod,
1385
+			&i.StarCount,
1386
+			&i.WatcherCount,
1387
+			&i.ForkCount,
1388
+			&i.InitStatus,
1389
+			&i.LastIndexedOid,
1390
+		); err != nil {
1391
+			return nil, err
1392
+		}
1393
+		items = append(items, i)
1394
+	}
1395
+	if err := rows.Err(); err != nil {
1396
+		return nil, err
1397
+	}
1398
+	return items, nil
1399
+}
1400
+
10711401
 const listReposNeedingReindex = `-- name: ListReposNeedingReindex :many
10721402
 SELECT id, name, default_branch, default_branch_oid
10731403
 FROM repos