v0.11.0 dc50343

certificate_validations.sql.go RawHistoryFolder

1// Code generated by sqlc. DO NOT EDIT.
2// versions:
3//   sqlc v1.30.0
4// source: certificate_validations.sql
5
6package db
7
8import (
9	"context"
10	"database/sql"
11)
12
13const DeleteCertificateValidation = `-- name: DeleteCertificateValidation :exec
14DELETE FROM certificate_validations 
15WHERE hostname = ? AND certificate_hash = ?
16`
17
18func (q *Queries) DeleteCertificateValidation(ctx context.Context, hostname string, certificateHash string) error {
19	_, err := q.db.ExecContext(ctx, DeleteCertificateValidation, hostname, certificateHash)
20	return err
21}
22
23const DeleteExpiredCertificateValidations = `-- name: DeleteExpiredCertificateValidations :exec
24DELETE FROM certificate_validations 
25WHERE expires_at IS NOT NULL AND expires_at <= datetime('now')
26`
27
28func (q *Queries) DeleteExpiredCertificateValidations(ctx context.Context) error {
29	_, err := q.db.ExecContext(ctx, DeleteExpiredCertificateValidations)
30	return err
31}
32
33const GetCertificateValidation = `-- name: GetCertificateValidation :one
34SELECT id, hostname, certificate_hash, user_decision, created_at, expires_at FROM certificate_validations 
35WHERE hostname = ? AND certificate_hash = ? 
36AND (expires_at IS NULL OR expires_at > datetime('now'))
37LIMIT 1
38`
39
40func (q *Queries) GetCertificateValidation(ctx context.Context, hostname string, certificateHash string) (CertificateValidation, error) {
41	row := q.db.QueryRowContext(ctx, GetCertificateValidation, hostname, certificateHash)
42	var i CertificateValidation
43	err := row.Scan(
44		&i.ID,
45		&i.Hostname,
46		&i.CertificateHash,
47		&i.UserDecision,
48		&i.CreatedAt,
49		&i.ExpiresAt,
50	)
51	return i, err
52}
53
54const StoreCertificateValidation = `-- name: StoreCertificateValidation :exec
55INSERT OR REPLACE INTO certificate_validations (hostname, certificate_hash, user_decision, expires_at)
56VALUES (?, ?, ?, ?)
57`
58
59func (q *Queries) StoreCertificateValidation(ctx context.Context, hostname string, certificateHash string, userDecision string, expiresAt sql.NullTime) error {
60	_, err := q.db.ExecContext(ctx, StoreCertificateValidation,
61		hostname,
62		certificateHash,
63		userDecision,
64		expiresAt,
65	)
66	return err
67}

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