Go · 9872 bytes Raw Blame History
1 // Code generated by sqlc. DO NOT EDIT.
2 // versions:
3 // sqlc v1.31.1
4
5 package metadb
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 BranchProtectionRule struct {
208 ID int64
209 RepoID int64
210 Pattern string
211 PreventForcePush bool
212 PreventDeletion bool
213 RequirePrForPush bool
214 AllowedPusherUserIds []int64
215 RequireSignedCommits bool
216 StatusChecksRequired []string
217 CreatedAt pgtype.Timestamptz
218 UpdatedAt pgtype.Timestamptz
219 CreatedByUserID pgtype.Int8
220 }
221
222 type EmailVerification struct {
223 ID int64
224 UserEmailID int64
225 TokenHash []byte
226 ExpiresAt pgtype.Timestamptz
227 UsedAt pgtype.Timestamptz
228 CreatedAt pgtype.Timestamptz
229 }
230
231 type Job struct {
232 ID int64
233 Kind string
234 Payload []byte
235 RunAt pgtype.Timestamptz
236 Attempts int32
237 MaxAttempts int32
238 LastError pgtype.Text
239 LockedBy pgtype.Text
240 LockedAt pgtype.Timestamptz
241 CompletedAt pgtype.Timestamptz
242 FailedAt pgtype.Timestamptz
243 CreatedAt pgtype.Timestamptz
244 }
245
246 type Meta struct {
247 Key string
248 Value []byte
249 UpdatedAt pgtype.Timestamptz
250 }
251
252 type PasswordReset struct {
253 ID int64
254 UserID int64
255 TokenHash []byte
256 ExpiresAt pgtype.Timestamptz
257 UsedAt pgtype.Timestamptz
258 CreatedAt pgtype.Timestamptz
259 }
260
261 type PushEvent struct {
262 ID int64
263 RepoID int64
264 PusherUserID pgtype.Int8
265 BeforeSha string
266 AfterSha string
267 Ref string
268 Protocol string
269 RequestID string
270 ProcessedAt pgtype.Timestamptz
271 CreatedAt pgtype.Timestamptz
272 }
273
274 type Repo struct {
275 ID int64
276 OwnerUserID pgtype.Int8
277 OwnerOrgID pgtype.Int8
278 Name string
279 Description string
280 Visibility RepoVisibility
281 DefaultBranch string
282 IsArchived bool
283 ArchivedAt pgtype.Timestamptz
284 DeletedAt pgtype.Timestamptz
285 DiskUsedBytes int64
286 ForkOfRepoID pgtype.Int8
287 LicenseKey pgtype.Text
288 PrimaryLanguage pgtype.Text
289 HasIssues bool
290 HasPulls bool
291 CreatedAt pgtype.Timestamptz
292 UpdatedAt pgtype.Timestamptz
293 DefaultBranchOid pgtype.Text
294 }
295
296 type RepoCollaborator struct {
297 RepoID int64
298 UserID int64
299 Role CollabRole
300 AddedAt pgtype.Timestamptz
301 AddedByUserID pgtype.Int8
302 }
303
304 type RepoRedirect struct {
305 OldOwnerUserID pgtype.Int8
306 OldOwnerOrgID pgtype.Int8
307 OldName string
308 RepoID int64
309 RedirectedAt pgtype.Timestamptz
310 }
311
312 type RepoTransferRequest struct {
313 ID int64
314 RepoID int64
315 FromUserID int64
316 ToPrincipalKind TransferPrincipalKind
317 ToPrincipalID int64
318 CreatedBy int64
319 CreatedAt pgtype.Timestamptz
320 ExpiresAt pgtype.Timestamptz
321 Status TransferStatus
322 AcceptedAt pgtype.Timestamptz
323 DeclinedAt pgtype.Timestamptz
324 CanceledAt pgtype.Timestamptz
325 }
326
327 type User struct {
328 ID int64
329 Username string
330 DisplayName string
331 PrimaryEmailID pgtype.Int8
332 PasswordHash string
333 PasswordAlgo string
334 PasswordUpdatedAt pgtype.Timestamptz
335 EmailVerified bool
336 LastLoginAt pgtype.Timestamptz
337 SuspendedAt pgtype.Timestamptz
338 SuspendedReason pgtype.Text
339 DeletedAt pgtype.Timestamptz
340 CreatedAt pgtype.Timestamptz
341 UpdatedAt pgtype.Timestamptz
342 Bio string
343 Location string
344 Website string
345 Company string
346 Pronouns string
347 AvatarObjectKey pgtype.Text
348 Theme string
349 SessionEpoch int32
350 }
351
352 type UserEmail struct {
353 ID int64
354 UserID int64
355 Email string
356 IsPrimary bool
357 Verified bool
358 VerificationTokenHash []byte
359 VerificationSentAt pgtype.Timestamptz
360 VerifiedAt pgtype.Timestamptz
361 CreatedAt pgtype.Timestamptz
362 }
363
364 type UserNotificationPref struct {
365 UserID int64
366 Key string
367 Value []byte
368 UpdatedAt pgtype.Timestamptz
369 }
370
371 type UserRecoveryCode struct {
372 ID int64
373 UserID int64
374 CodeHash []byte
375 UsedAt pgtype.Timestamptz
376 GeneratedAt pgtype.Timestamptz
377 CreatedAt pgtype.Timestamptz
378 }
379
380 type UserSshKey struct {
381 ID int64
382 UserID int64
383 Title string
384 FingerprintSha256 string
385 KeyType string
386 KeyBits int32
387 PublicKey string
388 LastUsedAt pgtype.Timestamptz
389 LastUsedIp *netip.Addr
390 CreatedAt pgtype.Timestamptz
391 }
392
393 type UserToken struct {
394 ID int64
395 UserID int64
396 Name string
397 TokenHash []byte
398 TokenPrefix string
399 Scopes []string
400 ExpiresAt pgtype.Timestamptz
401 LastUsedAt pgtype.Timestamptz
402 LastUsedIp *netip.Addr
403 RevokedAt pgtype.Timestamptz
404 CreatedAt pgtype.Timestamptz
405 }
406
407 type UserTotp struct {
408 ID int64
409 UserID int64
410 SecretEncrypted []byte
411 SecretNonce []byte
412 ConfirmedAt pgtype.Timestamptz
413 LastUsedCounter int64
414 CreatedAt pgtype.Timestamptz
415 UpdatedAt pgtype.Timestamptz
416 }
417
418 type UsernameRedirect struct {
419 OldUsername string
420 UserID int64
421 ChangedAt pgtype.Timestamptz
422 }
423
424 type WebhookEventsPending struct {
425 ID int64
426 RepoID int64
427 EventKind string
428 Payload []byte
429 CreatedAt pgtype.Timestamptz
430 }
431