v0.25.0 2e6c485

whitelist.sql.go RawHistoryFolder

1// Code generated by sqlc. DO NOT EDIT.
2// versions:
3//   sqlc v1.30.0
4// source: whitelist.sql
5
6package sqlc
7
8import (
9	"context"
10)
11
12const AddToWhitelist = `-- name: AddToWhitelist :exec
13INSERT OR IGNORE INTO content_whitelist (domain, created_at) VALUES (?, CURRENT_TIMESTAMP)
14`
15
16func (q *Queries) AddToWhitelist(ctx context.Context, domain string) error {
17	_, err := q.db.ExecContext(ctx, AddToWhitelist, domain)
18	return err
19}
20
21const GetAllWhitelistedDomains = `-- name: GetAllWhitelistedDomains :many
22SELECT domain FROM content_whitelist ORDER BY domain
23`
24
25func (q *Queries) GetAllWhitelistedDomains(ctx context.Context) ([]string, error) {
26	rows, err := q.db.QueryContext(ctx, GetAllWhitelistedDomains)
27	if err != nil {
28		return nil, err
29	}
30	defer rows.Close()
31	items := []string{}
32	for rows.Next() {
33		var domain string
34		if err := rows.Scan(&domain); err != nil {
35			return nil, err
36		}
37		items = append(items, domain)
38	}
39	if err := rows.Close(); err != nil {
40		return nil, err
41	}
42	if err := rows.Err(); err != nil {
43		return nil, err
44	}
45	return items, nil
46}
47
48const IsWhitelisted = `-- name: IsWhitelisted :one
49SELECT COUNT(*) FROM content_whitelist WHERE domain = ? LIMIT 1
50`
51
52func (q *Queries) IsWhitelisted(ctx context.Context, domain string) (int64, error) {
53	row := q.db.QueryRowContext(ctx, IsWhitelisted, domain)
54	var count int64
55	err := row.Scan(&count)
56	return count, err
57}
58
59const RemoveFromWhitelist = `-- name: RemoveFromWhitelist :exec
60DELETE FROM content_whitelist WHERE domain = ?
61`
62
63func (q *Queries) RemoveFromWhitelist(ctx context.Context, domain string) error {
64	_, err := q.db.ExecContext(ctx, RemoveFromWhitelist, domain)
65	return err
66}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close