Go · 9465 bytes Raw Blame History
1 // Code generated by sqlc. DO NOT EDIT.
2 // versions:
3 // sqlc v1.31.1
4
5 package reposdb
6
7 import (
8 "database/sql/driver"
9 "fmt"
10 "net/netip"
11
12 "github.com/jackc/pgx/v5/pgtype"
13 )
14
15 type CollabRole string
16
17 const (
18 CollabRoleRead CollabRole = "read"
19 CollabRoleTriage CollabRole = "triage"
20 CollabRoleWrite CollabRole = "write"
21 CollabRoleMaintain CollabRole = "maintain"
22 CollabRoleAdmin CollabRole = "admin"
23 )
24
25 func (e *CollabRole) Scan(src interface{}) error {
26 switch s := src.(type) {
27 case []byte:
28 *e = CollabRole(s)
29 case string:
30 *e = CollabRole(s)
31 default:
32 return fmt.Errorf("unsupported scan type for CollabRole: %T", src)
33 }
34 return nil
35 }
36
37 type NullCollabRole struct {
38 CollabRole CollabRole
39 Valid bool // Valid is true if CollabRole is not NULL
40 }
41
42 // Scan implements the Scanner interface.
43 func (ns *NullCollabRole) Scan(value interface{}) error {
44 if value == nil {
45 ns.CollabRole, ns.Valid = "", false
46 return nil
47 }
48 ns.Valid = true
49 return ns.CollabRole.Scan(value)
50 }
51
52 // Value implements the driver Valuer interface.
53 func (ns NullCollabRole) Value() (driver.Value, error) {
54 if !ns.Valid {
55 return nil, nil
56 }
57 return string(ns.CollabRole), nil
58 }
59
60 type RepoVisibility string
61
62 const (
63 RepoVisibilityPublic RepoVisibility = "public"
64 RepoVisibilityPrivate RepoVisibility = "private"
65 )
66
67 func (e *RepoVisibility) Scan(src interface{}) error {
68 switch s := src.(type) {
69 case []byte:
70 *e = RepoVisibility(s)
71 case string:
72 *e = RepoVisibility(s)
73 default:
74 return fmt.Errorf("unsupported scan type for RepoVisibility: %T", src)
75 }
76 return nil
77 }
78
79 type NullRepoVisibility struct {
80 RepoVisibility RepoVisibility
81 Valid bool // Valid is true if RepoVisibility is not NULL
82 }
83
84 // Scan implements the Scanner interface.
85 func (ns *NullRepoVisibility) Scan(value interface{}) error {
86 if value == nil {
87 ns.RepoVisibility, ns.Valid = "", false
88 return nil
89 }
90 ns.Valid = true
91 return ns.RepoVisibility.Scan(value)
92 }
93
94 // Value implements the driver Valuer interface.
95 func (ns NullRepoVisibility) Value() (driver.Value, error) {
96 if !ns.Valid {
97 return nil, nil
98 }
99 return string(ns.RepoVisibility), nil
100 }
101
102 type TransferPrincipalKind string
103
104 const (
105 TransferPrincipalKindUser TransferPrincipalKind = "user"
106 TransferPrincipalKindOrg TransferPrincipalKind = "org"
107 )
108
109 func (e *TransferPrincipalKind) Scan(src interface{}) error {
110 switch s := src.(type) {
111 case []byte:
112 *e = TransferPrincipalKind(s)
113 case string:
114 *e = TransferPrincipalKind(s)
115 default:
116 return fmt.Errorf("unsupported scan type for TransferPrincipalKind: %T", src)
117 }
118 return nil
119 }
120
121 type NullTransferPrincipalKind struct {
122 TransferPrincipalKind TransferPrincipalKind
123 Valid bool // Valid is true if TransferPrincipalKind is not NULL
124 }
125
126 // Scan implements the Scanner interface.
127 func (ns *NullTransferPrincipalKind) Scan(value interface{}) error {
128 if value == nil {
129 ns.TransferPrincipalKind, ns.Valid = "", false
130 return nil
131 }
132 ns.Valid = true
133 return ns.TransferPrincipalKind.Scan(value)
134 }
135
136 // Value implements the driver Valuer interface.
137 func (ns NullTransferPrincipalKind) Value() (driver.Value, error) {
138 if !ns.Valid {
139 return nil, nil
140 }
141 return string(ns.TransferPrincipalKind), nil
142 }
143
144 type TransferStatus string
145
146 const (
147 TransferStatusPending TransferStatus = "pending"
148 TransferStatusAccepted TransferStatus = "accepted"
149 TransferStatusDeclined TransferStatus = "declined"
150 TransferStatusCanceled TransferStatus = "canceled"
151 TransferStatusExpired TransferStatus = "expired"
152 )
153
154 func (e *TransferStatus) Scan(src interface{}) error {
155 switch s := src.(type) {
156 case []byte:
157 *e = TransferStatus(s)
158 case string:
159 *e = TransferStatus(s)
160 default:
161 return fmt.Errorf("unsupported scan type for TransferStatus: %T", src)
162 }
163 return nil
164 }
165
166 type NullTransferStatus struct {
167 TransferStatus TransferStatus
168 Valid bool // Valid is true if TransferStatus is not NULL
169 }
170
171 // Scan implements the Scanner interface.
172 func (ns *NullTransferStatus) Scan(value interface{}) error {
173 if value == nil {
174 ns.TransferStatus, ns.Valid = "", false
175 return nil
176 }
177 ns.Valid = true
178 return ns.TransferStatus.Scan(value)
179 }
180
181 // Value implements the driver Valuer interface.
182 func (ns NullTransferStatus) Value() (driver.Value, error) {
183 if !ns.Valid {
184 return nil, nil
185 }
186 return string(ns.TransferStatus), nil
187 }
188
189 type AuthAuditLog struct {
190 ID int64
191 ActorID pgtype.Int8
192 Action string
193 TargetType string
194 TargetID pgtype.Int8
195 Meta []byte
196 CreatedAt pgtype.Timestamptz
197 }
198
199 type AuthThrottle struct {
200 ID int64
201 Scope string
202 Identifier string
203 Hits int32
204 WindowStartedAt pgtype.Timestamptz
205 }
206
207 type EmailVerification struct {
208 ID int64
209 UserEmailID int64
210 TokenHash []byte
211 ExpiresAt pgtype.Timestamptz
212 UsedAt pgtype.Timestamptz
213 CreatedAt pgtype.Timestamptz
214 }
215
216 type Job struct {
217 ID int64
218 Kind string
219 Payload []byte
220 RunAt pgtype.Timestamptz
221 Attempts int32
222 MaxAttempts int32
223 LastError pgtype.Text
224 LockedBy pgtype.Text
225 LockedAt pgtype.Timestamptz
226 CompletedAt pgtype.Timestamptz
227 FailedAt pgtype.Timestamptz
228 CreatedAt pgtype.Timestamptz
229 }
230
231 type Meta struct {
232 Key string
233 Value []byte
234 UpdatedAt pgtype.Timestamptz
235 }
236
237 type PasswordReset struct {
238 ID int64
239 UserID int64
240 TokenHash []byte
241 ExpiresAt pgtype.Timestamptz
242 UsedAt pgtype.Timestamptz
243 CreatedAt pgtype.Timestamptz
244 }
245
246 type PushEvent struct {
247 ID int64
248 RepoID int64
249 PusherUserID pgtype.Int8
250 BeforeSha string
251 AfterSha string
252 Ref string
253 Protocol string
254 RequestID string
255 ProcessedAt pgtype.Timestamptz
256 CreatedAt pgtype.Timestamptz
257 }
258
259 type Repo struct {
260 ID int64
261 OwnerUserID pgtype.Int8
262 OwnerOrgID pgtype.Int8
263 Name string
264 Description string
265 Visibility RepoVisibility
266 DefaultBranch string
267 IsArchived bool
268 ArchivedAt pgtype.Timestamptz
269 DeletedAt pgtype.Timestamptz
270 DiskUsedBytes int64
271 ForkOfRepoID pgtype.Int8
272 LicenseKey pgtype.Text
273 PrimaryLanguage pgtype.Text
274 HasIssues bool
275 HasPulls bool
276 CreatedAt pgtype.Timestamptz
277 UpdatedAt pgtype.Timestamptz
278 DefaultBranchOid pgtype.Text
279 }
280
281 type RepoCollaborator struct {
282 RepoID int64
283 UserID int64
284 Role CollabRole
285 AddedAt pgtype.Timestamptz
286 AddedByUserID pgtype.Int8
287 }
288
289 type RepoRedirect struct {
290 OldOwnerUserID pgtype.Int8
291 OldOwnerOrgID pgtype.Int8
292 OldName string
293 RepoID int64
294 RedirectedAt pgtype.Timestamptz
295 }
296
297 type RepoTransferRequest struct {
298 ID int64
299 RepoID int64
300 FromUserID int64
301 ToPrincipalKind TransferPrincipalKind
302 ToPrincipalID int64
303 CreatedBy int64
304 CreatedAt pgtype.Timestamptz
305 ExpiresAt pgtype.Timestamptz
306 Status TransferStatus
307 AcceptedAt pgtype.Timestamptz
308 DeclinedAt pgtype.Timestamptz
309 CanceledAt pgtype.Timestamptz
310 }
311
312 type User struct {
313 ID int64
314 Username string
315 DisplayName string
316 PrimaryEmailID pgtype.Int8
317 PasswordHash string
318 PasswordAlgo string
319 PasswordUpdatedAt pgtype.Timestamptz
320 EmailVerified bool
321 LastLoginAt pgtype.Timestamptz
322 SuspendedAt pgtype.Timestamptz
323 SuspendedReason pgtype.Text
324 DeletedAt pgtype.Timestamptz
325 CreatedAt pgtype.Timestamptz
326 UpdatedAt pgtype.Timestamptz
327 Bio string
328 Location string
329 Website string
330 Company string
331 Pronouns string
332 AvatarObjectKey pgtype.Text
333 Theme string
334 SessionEpoch int32
335 }
336
337 type UserEmail struct {
338 ID int64
339 UserID int64
340 Email string
341 IsPrimary bool
342 Verified bool
343 VerificationTokenHash []byte
344 VerificationSentAt pgtype.Timestamptz
345 VerifiedAt pgtype.Timestamptz
346 CreatedAt pgtype.Timestamptz
347 }
348
349 type UserNotificationPref struct {
350 UserID int64
351 Key string
352 Value []byte
353 UpdatedAt pgtype.Timestamptz
354 }
355
356 type UserRecoveryCode struct {
357 ID int64
358 UserID int64
359 CodeHash []byte
360 UsedAt pgtype.Timestamptz
361 GeneratedAt pgtype.Timestamptz
362 CreatedAt pgtype.Timestamptz
363 }
364
365 type UserSshKey struct {
366 ID int64
367 UserID int64
368 Title string
369 FingerprintSha256 string
370 KeyType string
371 KeyBits int32
372 PublicKey string
373 LastUsedAt pgtype.Timestamptz
374 LastUsedIp *netip.Addr
375 CreatedAt pgtype.Timestamptz
376 }
377
378 type UserToken struct {
379 ID int64
380 UserID int64
381 Name string
382 TokenHash []byte
383 TokenPrefix string
384 Scopes []string
385 ExpiresAt pgtype.Timestamptz
386 LastUsedAt pgtype.Timestamptz
387 LastUsedIp *netip.Addr
388 RevokedAt pgtype.Timestamptz
389 CreatedAt pgtype.Timestamptz
390 }
391
392 type UserTotp struct {
393 ID int64
394 UserID int64
395 SecretEncrypted []byte
396 SecretNonce []byte
397 ConfirmedAt pgtype.Timestamptz
398 LastUsedCounter int64
399 CreatedAt pgtype.Timestamptz
400 UpdatedAt pgtype.Timestamptz
401 }
402
403 type UsernameRedirect struct {
404 OldUsername string
405 UserID int64
406 ChangedAt pgtype.Timestamptz
407 }
408
409 type WebhookEventsPending struct {
410 ID int64
411 RepoID int64
412 EventKind string
413 Payload []byte
414 CreatedAt pgtype.Timestamptz
415 }
416