| 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 AuthAuditLog struct { |
| 103 | ID int64 |
| 104 | ActorID pgtype.Int8 |
| 105 | Action string |
| 106 | TargetType string |
| 107 | TargetID pgtype.Int8 |
| 108 | Meta []byte |
| 109 | CreatedAt pgtype.Timestamptz |
| 110 | } |
| 111 | |
| 112 | type AuthThrottle struct { |
| 113 | ID int64 |
| 114 | Scope string |
| 115 | Identifier string |
| 116 | Hits int32 |
| 117 | WindowStartedAt pgtype.Timestamptz |
| 118 | } |
| 119 | |
| 120 | type EmailVerification struct { |
| 121 | ID int64 |
| 122 | UserEmailID int64 |
| 123 | TokenHash []byte |
| 124 | ExpiresAt pgtype.Timestamptz |
| 125 | UsedAt pgtype.Timestamptz |
| 126 | CreatedAt pgtype.Timestamptz |
| 127 | } |
| 128 | |
| 129 | type Job struct { |
| 130 | ID int64 |
| 131 | Kind string |
| 132 | Payload []byte |
| 133 | RunAt pgtype.Timestamptz |
| 134 | Attempts int32 |
| 135 | MaxAttempts int32 |
| 136 | LastError pgtype.Text |
| 137 | LockedBy pgtype.Text |
| 138 | LockedAt pgtype.Timestamptz |
| 139 | CompletedAt pgtype.Timestamptz |
| 140 | FailedAt pgtype.Timestamptz |
| 141 | CreatedAt pgtype.Timestamptz |
| 142 | } |
| 143 | |
| 144 | type Meta struct { |
| 145 | Key string |
| 146 | Value []byte |
| 147 | UpdatedAt pgtype.Timestamptz |
| 148 | } |
| 149 | |
| 150 | type PasswordReset struct { |
| 151 | ID int64 |
| 152 | UserID int64 |
| 153 | TokenHash []byte |
| 154 | ExpiresAt pgtype.Timestamptz |
| 155 | UsedAt pgtype.Timestamptz |
| 156 | CreatedAt pgtype.Timestamptz |
| 157 | } |
| 158 | |
| 159 | type PushEvent struct { |
| 160 | ID int64 |
| 161 | RepoID int64 |
| 162 | PusherUserID pgtype.Int8 |
| 163 | BeforeSha string |
| 164 | AfterSha string |
| 165 | Ref string |
| 166 | Protocol string |
| 167 | RequestID string |
| 168 | ProcessedAt pgtype.Timestamptz |
| 169 | CreatedAt pgtype.Timestamptz |
| 170 | } |
| 171 | |
| 172 | type Repo struct { |
| 173 | ID int64 |
| 174 | OwnerUserID pgtype.Int8 |
| 175 | OwnerOrgID pgtype.Int8 |
| 176 | Name string |
| 177 | Description string |
| 178 | Visibility RepoVisibility |
| 179 | DefaultBranch string |
| 180 | IsArchived bool |
| 181 | ArchivedAt pgtype.Timestamptz |
| 182 | DeletedAt pgtype.Timestamptz |
| 183 | DiskUsedBytes int64 |
| 184 | ForkOfRepoID pgtype.Int8 |
| 185 | LicenseKey pgtype.Text |
| 186 | PrimaryLanguage pgtype.Text |
| 187 | HasIssues bool |
| 188 | HasPulls bool |
| 189 | CreatedAt pgtype.Timestamptz |
| 190 | UpdatedAt pgtype.Timestamptz |
| 191 | DefaultBranchOid pgtype.Text |
| 192 | } |
| 193 | |
| 194 | type RepoCollaborator struct { |
| 195 | RepoID int64 |
| 196 | UserID int64 |
| 197 | Role CollabRole |
| 198 | AddedAt pgtype.Timestamptz |
| 199 | AddedByUserID pgtype.Int8 |
| 200 | } |
| 201 | |
| 202 | type User struct { |
| 203 | ID int64 |
| 204 | Username string |
| 205 | DisplayName string |
| 206 | PrimaryEmailID pgtype.Int8 |
| 207 | PasswordHash string |
| 208 | PasswordAlgo string |
| 209 | PasswordUpdatedAt pgtype.Timestamptz |
| 210 | EmailVerified bool |
| 211 | LastLoginAt pgtype.Timestamptz |
| 212 | SuspendedAt pgtype.Timestamptz |
| 213 | SuspendedReason pgtype.Text |
| 214 | DeletedAt pgtype.Timestamptz |
| 215 | CreatedAt pgtype.Timestamptz |
| 216 | UpdatedAt pgtype.Timestamptz |
| 217 | Bio string |
| 218 | Location string |
| 219 | Website string |
| 220 | Company string |
| 221 | Pronouns string |
| 222 | AvatarObjectKey pgtype.Text |
| 223 | Theme string |
| 224 | SessionEpoch int32 |
| 225 | } |
| 226 | |
| 227 | type UserEmail struct { |
| 228 | ID int64 |
| 229 | UserID int64 |
| 230 | Email string |
| 231 | IsPrimary bool |
| 232 | Verified bool |
| 233 | VerificationTokenHash []byte |
| 234 | VerificationSentAt pgtype.Timestamptz |
| 235 | VerifiedAt pgtype.Timestamptz |
| 236 | CreatedAt pgtype.Timestamptz |
| 237 | } |
| 238 | |
| 239 | type UserNotificationPref struct { |
| 240 | UserID int64 |
| 241 | Key string |
| 242 | Value []byte |
| 243 | UpdatedAt pgtype.Timestamptz |
| 244 | } |
| 245 | |
| 246 | type UserRecoveryCode struct { |
| 247 | ID int64 |
| 248 | UserID int64 |
| 249 | CodeHash []byte |
| 250 | UsedAt pgtype.Timestamptz |
| 251 | GeneratedAt pgtype.Timestamptz |
| 252 | CreatedAt pgtype.Timestamptz |
| 253 | } |
| 254 | |
| 255 | type UserSshKey struct { |
| 256 | ID int64 |
| 257 | UserID int64 |
| 258 | Title string |
| 259 | FingerprintSha256 string |
| 260 | KeyType string |
| 261 | KeyBits int32 |
| 262 | PublicKey string |
| 263 | LastUsedAt pgtype.Timestamptz |
| 264 | LastUsedIp *netip.Addr |
| 265 | CreatedAt pgtype.Timestamptz |
| 266 | } |
| 267 | |
| 268 | type UserToken struct { |
| 269 | ID int64 |
| 270 | UserID int64 |
| 271 | Name string |
| 272 | TokenHash []byte |
| 273 | TokenPrefix string |
| 274 | Scopes []string |
| 275 | ExpiresAt pgtype.Timestamptz |
| 276 | LastUsedAt pgtype.Timestamptz |
| 277 | LastUsedIp *netip.Addr |
| 278 | RevokedAt pgtype.Timestamptz |
| 279 | CreatedAt pgtype.Timestamptz |
| 280 | } |
| 281 | |
| 282 | type UserTotp struct { |
| 283 | ID int64 |
| 284 | UserID int64 |
| 285 | SecretEncrypted []byte |
| 286 | SecretNonce []byte |
| 287 | ConfirmedAt pgtype.Timestamptz |
| 288 | LastUsedCounter int64 |
| 289 | CreatedAt pgtype.Timestamptz |
| 290 | UpdatedAt pgtype.Timestamptz |
| 291 | } |
| 292 | |
| 293 | type UsernameRedirect struct { |
| 294 | OldUsername string |
| 295 | UserID int64 |
| 296 | ChangedAt pgtype.Timestamptz |
| 297 | } |
| 298 | |
| 299 | type WebhookEventsPending struct { |
| 300 | ID int64 |
| 301 | RepoID int64 |
| 302 | EventKind string |
| 303 | Payload []byte |
| 304 | CreatedAt pgtype.Timestamptz |
| 305 | } |
| 306 |