Go · 5522 bytes Raw Blame History
1 // Code generated by sqlc. DO NOT EDIT.
2 // versions:
3 // sqlc v1.31.1
4
5 package workerdb
6
7 import (
8 "database/sql/driver"
9 "fmt"
10 "net/netip"
11
12 "github.com/jackc/pgx/v5/pgtype"
13 )
14
15 type RepoVisibility string
16
17 const (
18 RepoVisibilityPublic RepoVisibility = "public"
19 RepoVisibilityPrivate RepoVisibility = "private"
20 )
21
22 func (e *RepoVisibility) Scan(src interface{}) error {
23 switch s := src.(type) {
24 case []byte:
25 *e = RepoVisibility(s)
26 case string:
27 *e = RepoVisibility(s)
28 default:
29 return fmt.Errorf("unsupported scan type for RepoVisibility: %T", src)
30 }
31 return nil
32 }
33
34 type NullRepoVisibility struct {
35 RepoVisibility RepoVisibility
36 Valid bool // Valid is true if RepoVisibility is not NULL
37 }
38
39 // Scan implements the Scanner interface.
40 func (ns *NullRepoVisibility) Scan(value interface{}) error {
41 if value == nil {
42 ns.RepoVisibility, ns.Valid = "", false
43 return nil
44 }
45 ns.Valid = true
46 return ns.RepoVisibility.Scan(value)
47 }
48
49 // Value implements the driver Valuer interface.
50 func (ns NullRepoVisibility) Value() (driver.Value, error) {
51 if !ns.Valid {
52 return nil, nil
53 }
54 return string(ns.RepoVisibility), nil
55 }
56
57 type AuthAuditLog struct {
58 ID int64
59 ActorID pgtype.Int8
60 Action string
61 TargetType string
62 TargetID pgtype.Int8
63 Meta []byte
64 CreatedAt pgtype.Timestamptz
65 }
66
67 type AuthThrottle struct {
68 ID int64
69 Scope string
70 Identifier string
71 Hits int32
72 WindowStartedAt pgtype.Timestamptz
73 }
74
75 type EmailVerification struct {
76 ID int64
77 UserEmailID int64
78 TokenHash []byte
79 ExpiresAt pgtype.Timestamptz
80 UsedAt pgtype.Timestamptz
81 CreatedAt pgtype.Timestamptz
82 }
83
84 type Job struct {
85 ID int64
86 Kind string
87 Payload []byte
88 RunAt pgtype.Timestamptz
89 Attempts int32
90 MaxAttempts int32
91 LastError pgtype.Text
92 LockedBy pgtype.Text
93 LockedAt pgtype.Timestamptz
94 CompletedAt pgtype.Timestamptz
95 FailedAt pgtype.Timestamptz
96 CreatedAt pgtype.Timestamptz
97 }
98
99 type Meta struct {
100 Key string
101 Value []byte
102 UpdatedAt pgtype.Timestamptz
103 }
104
105 type PasswordReset struct {
106 ID int64
107 UserID int64
108 TokenHash []byte
109 ExpiresAt pgtype.Timestamptz
110 UsedAt pgtype.Timestamptz
111 CreatedAt pgtype.Timestamptz
112 }
113
114 type PushEvent struct {
115 ID int64
116 RepoID int64
117 PusherUserID pgtype.Int8
118 BeforeSha string
119 AfterSha string
120 Ref string
121 Protocol string
122 RequestID string
123 ProcessedAt pgtype.Timestamptz
124 CreatedAt pgtype.Timestamptz
125 }
126
127 type Repo struct {
128 ID int64
129 OwnerUserID pgtype.Int8
130 OwnerOrgID pgtype.Int8
131 Name string
132 Description string
133 Visibility RepoVisibility
134 DefaultBranch string
135 IsArchived bool
136 ArchivedAt pgtype.Timestamptz
137 DeletedAt pgtype.Timestamptz
138 DiskUsedBytes int64
139 ForkOfRepoID pgtype.Int8
140 LicenseKey pgtype.Text
141 PrimaryLanguage pgtype.Text
142 HasIssues bool
143 HasPulls bool
144 CreatedAt pgtype.Timestamptz
145 UpdatedAt pgtype.Timestamptz
146 DefaultBranchOid pgtype.Text
147 }
148
149 type User struct {
150 ID int64
151 Username string
152 DisplayName string
153 PrimaryEmailID pgtype.Int8
154 PasswordHash string
155 PasswordAlgo string
156 PasswordUpdatedAt pgtype.Timestamptz
157 EmailVerified bool
158 LastLoginAt pgtype.Timestamptz
159 SuspendedAt pgtype.Timestamptz
160 SuspendedReason pgtype.Text
161 DeletedAt pgtype.Timestamptz
162 CreatedAt pgtype.Timestamptz
163 UpdatedAt pgtype.Timestamptz
164 Bio string
165 Location string
166 Website string
167 Company string
168 Pronouns string
169 AvatarObjectKey pgtype.Text
170 Theme string
171 SessionEpoch int32
172 }
173
174 type UserEmail struct {
175 ID int64
176 UserID int64
177 Email string
178 IsPrimary bool
179 Verified bool
180 VerificationTokenHash []byte
181 VerificationSentAt pgtype.Timestamptz
182 VerifiedAt pgtype.Timestamptz
183 CreatedAt pgtype.Timestamptz
184 }
185
186 type UserNotificationPref struct {
187 UserID int64
188 Key string
189 Value []byte
190 UpdatedAt pgtype.Timestamptz
191 }
192
193 type UserRecoveryCode struct {
194 ID int64
195 UserID int64
196 CodeHash []byte
197 UsedAt pgtype.Timestamptz
198 GeneratedAt pgtype.Timestamptz
199 CreatedAt pgtype.Timestamptz
200 }
201
202 type UserSshKey struct {
203 ID int64
204 UserID int64
205 Title string
206 FingerprintSha256 string
207 KeyType string
208 KeyBits int32
209 PublicKey string
210 LastUsedAt pgtype.Timestamptz
211 LastUsedIp *netip.Addr
212 CreatedAt pgtype.Timestamptz
213 }
214
215 type UserToken struct {
216 ID int64
217 UserID int64
218 Name string
219 TokenHash []byte
220 TokenPrefix string
221 Scopes []string
222 ExpiresAt pgtype.Timestamptz
223 LastUsedAt pgtype.Timestamptz
224 LastUsedIp *netip.Addr
225 RevokedAt pgtype.Timestamptz
226 CreatedAt pgtype.Timestamptz
227 }
228
229 type UserTotp struct {
230 ID int64
231 UserID int64
232 SecretEncrypted []byte
233 SecretNonce []byte
234 ConfirmedAt pgtype.Timestamptz
235 LastUsedCounter int64
236 CreatedAt pgtype.Timestamptz
237 UpdatedAt pgtype.Timestamptz
238 }
239
240 type UsernameRedirect struct {
241 OldUsername string
242 UserID int64
243 ChangedAt pgtype.Timestamptz
244 }
245
246 type WebhookEventsPending struct {
247 ID int64
248 RepoID int64
249 EventKind string
250 Payload []byte
251 CreatedAt pgtype.Timestamptz
252 }
253