• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

michaelcoll / quiz-app / 16222154777

11 Jul 2025 02:12PM UTC coverage: 16.191% (-4.8%) from 21.006%
16222154777

push

github

web-flow
Merge pull request #744 from michaelcoll/dependabot/npm_and_yarn/internal/web/nuxt/devtools-2.3.0

chore(deps-dev): Bump @nuxt/devtools from 1.7.0 to 2.3.0 in /internal/web

454 of 2804 relevant lines covered (16.19%)

1.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/internal/back/infrastructure/sqlc/user.sql.go
1
/*
2
 * Copyright (c) 2023 Michaƫl COLL.
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
// Code generated by sqlc. DO NOT EDIT.
18
// versions:
19
//   sqlc v1.18.0
20
// source: user.sql
21

22
package sqlc
23

24
import (
25
        "context"
26

27
        "github.com/google/uuid"
28
)
29

30
const clearClassUsers = `-- name: ClearClassUsers :exec
31
UPDATE user
32
SET class_uuid = NULL
33
WHERE class_uuid = ?
34
`
35

36
func (q *Queries) ClearClassUsers(ctx context.Context, classUuid uuid.UUID) error {
×
37
        _, err := q.db.ExecContext(ctx, clearClassUsers, classUuid)
×
38
        return err
×
39
}
×
40

41
const createOrReplaceUser = `-- name: CreateOrReplaceUser :exec
42
REPLACE INTO user (id, login, name, picture, role_id)
43
VALUES (?, ?, ?, ?, ?)
44
`
45

46
type CreateOrReplaceUserParams struct {
47
        ID      string `db:"id"`
48
        Login   string `db:"login"`
49
        Name    string `db:"name"`
50
        Picture string `db:"picture"`
51
        RoleID  int8   `db:"role_id"`
52
}
53

54
func (q *Queries) CreateOrReplaceUser(ctx context.Context, arg CreateOrReplaceUserParams) error {
×
55
        _, err := q.db.ExecContext(ctx, createOrReplaceUser,
×
56
                arg.ID,
×
57
                arg.Login,
×
58
                arg.Name,
×
59
                arg.Picture,
×
60
                arg.RoleID,
×
61
        )
×
62
        return err
×
63
}
×
64

65
const findActiveUserById = `-- name: FindActiveUserById :one
66
SELECT id, login, name, picture, active, role_id, class_uuid, class_name
67
FROM user_class_view
68
WHERE id = ?
69
  AND active = 1
70
`
71

72
func (q *Queries) FindActiveUserById(ctx context.Context, id string) (UserClassView, error) {
×
73
        row := q.db.QueryRowContext(ctx, findActiveUserById, id)
×
74
        var i UserClassView
×
75
        err := row.Scan(
×
76
                &i.ID,
×
77
                &i.Login,
×
78
                &i.Name,
×
79
                &i.Picture,
×
80
                &i.Active,
×
81
                &i.RoleID,
×
82
                &i.ClassUuid,
×
83
                &i.ClassName,
×
84
        )
×
85
        return i, err
×
86
}
×
87

88
const findAllUser = `-- name: FindAllUser :many
89
SELECT id, login, name, picture, active, role_id, class_uuid, class_name
90
FROM user_class_view
91
`
92

93
func (q *Queries) FindAllUser(ctx context.Context) ([]UserClassView, error) {
×
94
        rows, err := q.db.QueryContext(ctx, findAllUser)
×
95
        if err != nil {
×
96
                return nil, err
×
97
        }
×
98
        defer rows.Close()
×
99
        items := []UserClassView{}
×
100
        for rows.Next() {
×
101
                var i UserClassView
×
102
                if err := rows.Scan(
×
103
                        &i.ID,
×
104
                        &i.Login,
×
105
                        &i.Name,
×
106
                        &i.Picture,
×
107
                        &i.Active,
×
108
                        &i.RoleID,
×
109
                        &i.ClassUuid,
×
110
                        &i.ClassName,
×
111
                ); err != nil {
×
112
                        return nil, err
×
113
                }
×
114
                items = append(items, i)
×
115
        }
116
        if err := rows.Close(); err != nil {
×
117
                return nil, err
×
118
        }
×
119
        if err := rows.Err(); err != nil {
×
120
                return nil, err
×
121
        }
×
122
        return items, nil
×
123
}
124

125
const findUserById = `-- name: FindUserById :one
126
SELECT id, login, name, picture, active, role_id, class_uuid, class_name
127
FROM user_class_view
128
WHERE id = ?
129
`
130

131
func (q *Queries) FindUserById(ctx context.Context, id string) (UserClassView, error) {
×
132
        row := q.db.QueryRowContext(ctx, findUserById, id)
×
133
        var i UserClassView
×
134
        err := row.Scan(
×
135
                &i.ID,
×
136
                &i.Login,
×
137
                &i.Name,
×
138
                &i.Picture,
×
139
                &i.Active,
×
140
                &i.RoleID,
×
141
                &i.ClassUuid,
×
142
                &i.ClassName,
×
143
        )
×
144
        return i, err
×
145
}
×
146

147
const updateUserActive = `-- name: UpdateUserActive :exec
148
UPDATE user
149
SET active = ?
150
WHERE id = ?
151
`
152

153
type UpdateUserActiveParams struct {
154
        Active bool   `db:"active"`
155
        ID     string `db:"id"`
156
}
157

158
func (q *Queries) UpdateUserActive(ctx context.Context, arg UpdateUserActiveParams) error {
×
159
        _, err := q.db.ExecContext(ctx, updateUserActive, arg.Active, arg.ID)
×
160
        return err
×
161
}
×
162

163
const updateUserClass = `-- name: UpdateUserClass :exec
164
UPDATE user
165
SET class_uuid = ?
166
WHERE id = ?
167
`
168

169
type UpdateUserClassParams struct {
170
        ClassUuid uuid.UUID `db:"class_uuid"`
171
        ID        string    `db:"id"`
172
}
173

174
func (q *Queries) UpdateUserClass(ctx context.Context, arg UpdateUserClassParams) error {
×
175
        _, err := q.db.ExecContext(ctx, updateUserClass, arg.ClassUuid, arg.ID)
×
176
        return err
×
177
}
×
178

179
const updateUserInfo = `-- name: UpdateUserInfo :exec
180
UPDATE user
181
SET login   = ?,
182
    name    = ?,
183
    picture = ?
184
WHERE id = ?
185
`
186

187
type UpdateUserInfoParams struct {
188
        Login   string `db:"login"`
189
        Name    string `db:"name"`
190
        Picture string `db:"picture"`
191
        ID      string `db:"id"`
192
}
193

194
func (q *Queries) UpdateUserInfo(ctx context.Context, arg UpdateUserInfoParams) error {
×
195
        _, err := q.db.ExecContext(ctx, updateUserInfo,
×
196
                arg.Login,
×
197
                arg.Name,
×
198
                arg.Picture,
×
199
                arg.ID,
×
200
        )
×
201
        return err
×
202
}
×
203

204
const updateUserRole = `-- name: UpdateUserRole :exec
205
UPDATE user
206
SET role_id = ?
207
WHERE id = ?
208
`
209

210
type UpdateUserRoleParams struct {
211
        RoleID int8   `db:"role_id"`
212
        ID     string `db:"id"`
213
}
214

215
func (q *Queries) UpdateUserRole(ctx context.Context, arg UpdateUserRoleParams) error {
×
216
        _, err := q.db.ExecContext(ctx, updateUserRole, arg.RoleID, arg.ID)
×
217
        return err
×
218
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc