Go · 4743 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 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 Meta struct {
85 Key string
86 Value []byte
87 UpdatedAt pgtype.Timestamptz
88 }
89
90 type PasswordReset struct {
91 ID int64
92 UserID int64
93 TokenHash []byte
94 ExpiresAt pgtype.Timestamptz
95 UsedAt pgtype.Timestamptz
96 CreatedAt pgtype.Timestamptz
97 }
98
99 type Repo struct {
100 ID int64
101 OwnerUserID pgtype.Int8
102 OwnerOrgID pgtype.Int8
103 Name string
104 Description string
105 Visibility RepoVisibility
106 DefaultBranch string
107 IsArchived bool
108 ArchivedAt pgtype.Timestamptz
109 DeletedAt pgtype.Timestamptz
110 DiskUsedBytes int64
111 ForkOfRepoID pgtype.Int8
112 LicenseKey pgtype.Text
113 PrimaryLanguage pgtype.Text
114 HasIssues bool
115 HasPulls bool
116 CreatedAt pgtype.Timestamptz
117 UpdatedAt pgtype.Timestamptz
118 }
119
120 type User struct {
121 ID int64
122 Username string
123 DisplayName string
124 PrimaryEmailID pgtype.Int8
125 PasswordHash string
126 PasswordAlgo string
127 PasswordUpdatedAt pgtype.Timestamptz
128 EmailVerified bool
129 LastLoginAt pgtype.Timestamptz
130 SuspendedAt pgtype.Timestamptz
131 SuspendedReason pgtype.Text
132 DeletedAt pgtype.Timestamptz
133 CreatedAt pgtype.Timestamptz
134 UpdatedAt pgtype.Timestamptz
135 Bio string
136 Location string
137 Website string
138 Company string
139 Pronouns string
140 AvatarObjectKey pgtype.Text
141 Theme string
142 SessionEpoch int32
143 }
144
145 type UserEmail struct {
146 ID int64
147 UserID int64
148 Email string
149 IsPrimary bool
150 Verified bool
151 VerificationTokenHash []byte
152 VerificationSentAt pgtype.Timestamptz
153 VerifiedAt pgtype.Timestamptz
154 CreatedAt pgtype.Timestamptz
155 }
156
157 type UserNotificationPref struct {
158 UserID int64
159 Key string
160 Value []byte
161 UpdatedAt pgtype.Timestamptz
162 }
163
164 type UserRecoveryCode struct {
165 ID int64
166 UserID int64
167 CodeHash []byte
168 UsedAt pgtype.Timestamptz
169 GeneratedAt pgtype.Timestamptz
170 CreatedAt pgtype.Timestamptz
171 }
172
173 type UserSshKey struct {
174 ID int64
175 UserID int64
176 Title string
177 FingerprintSha256 string
178 KeyType string
179 KeyBits int32
180 PublicKey string
181 LastUsedAt pgtype.Timestamptz
182 LastUsedIp *netip.Addr
183 CreatedAt pgtype.Timestamptz
184 }
185
186 type UserToken struct {
187 ID int64
188 UserID int64
189 Name string
190 TokenHash []byte
191 TokenPrefix string
192 Scopes []string
193 ExpiresAt pgtype.Timestamptz
194 LastUsedAt pgtype.Timestamptz
195 LastUsedIp *netip.Addr
196 RevokedAt pgtype.Timestamptz
197 CreatedAt pgtype.Timestamptz
198 }
199
200 type UserTotp struct {
201 ID int64
202 UserID int64
203 SecretEncrypted []byte
204 SecretNonce []byte
205 ConfirmedAt pgtype.Timestamptz
206 LastUsedCounter int64
207 CreatedAt pgtype.Timestamptz
208 UpdatedAt pgtype.Timestamptz
209 }
210
211 type UsernameRedirect struct {
212 OldUsername string
213 UserID int64
214 ChangedAt pgtype.Timestamptz
215 }
216