v0.4.0 6203a22

zoom.sql.go RawHistoryFolder

1// Code generated by sqlc. DO NOT EDIT.
2// versions:
3//   sqlc v1.30.0
4// source: zoom.sql
5
6package db
7
8import (
9	"context"
10	"database/sql"
11)
12
13const CleanupOldZoomLevels = `-- name: CleanupOldZoomLevels :exec
14DELETE FROM zoom_levels WHERE updated_at < datetime('now', '-' || ? || ' days')
15`
16
17// Cleanup zoom level entries older than specified days
18func (q *Queries) CleanupOldZoomLevels(ctx context.Context, dollar_1 sql.NullString) error {
19	_, err := q.db.ExecContext(ctx, CleanupOldZoomLevels, dollar_1)
20	return err
21}
22
23const DeleteZoomLevel = `-- name: DeleteZoomLevel :exec
24DELETE FROM zoom_levels WHERE domain = ?
25`
26
27// Delete zoom level setting for a domain
28func (q *Queries) DeleteZoomLevel(ctx context.Context, domain string) error {
29	_, err := q.db.ExecContext(ctx, DeleteZoomLevel, domain)
30	return err
31}
32
33const GetZoomLevel = `-- name: GetZoomLevel :one
34SELECT zoom_factor FROM zoom_levels WHERE domain = ? LIMIT 1
35`
36
37// Get zoom level for a specific domain
38func (q *Queries) GetZoomLevel(ctx context.Context, domain string) (float64, error) {
39	row := q.db.QueryRowContext(ctx, GetZoomLevel, domain)
40	var zoom_factor float64
41	err := row.Scan(&zoom_factor)
42	return zoom_factor, err
43}
44
45const GetZoomLevelWithDefault = `-- name: GetZoomLevelWithDefault :one
46SELECT COALESCE(
47    (SELECT zoom_factor FROM zoom_levels WHERE domain = ? LIMIT 1),
48    1.0
49) as zoom_factor
50`
51
52// Get zoom level for domain with default fallback
53func (q *Queries) GetZoomLevelWithDefault(ctx context.Context, domain string) (interface{}, error) {
54	row := q.db.QueryRowContext(ctx, GetZoomLevelWithDefault, domain)
55	var zoom_factor interface{}
56	err := row.Scan(&zoom_factor)
57	return zoom_factor, err
58}
59
60const ListZoomLevels = `-- name: ListZoomLevels :many
61SELECT domain, zoom_factor, updated_at FROM zoom_levels ORDER BY updated_at DESC
62`
63
64// List all zoom level settings ordered by most recently updated
65func (q *Queries) ListZoomLevels(ctx context.Context) ([]ZoomLevel, error) {
66	rows, err := q.db.QueryContext(ctx, ListZoomLevels)
67	if err != nil {
68		return nil, err
69	}
70	defer rows.Close()
71	items := []ZoomLevel{}
72	for rows.Next() {
73		var i ZoomLevel
74		if err := rows.Scan(&i.Domain, &i.ZoomFactor, &i.UpdatedAt); err != nil {
75			return nil, err
76		}
77		items = append(items, i)
78	}
79	if err := rows.Close(); err != nil {
80		return nil, err
81	}
82	if err := rows.Err(); err != nil {
83		return nil, err
84	}
85	return items, nil
86}
87
88const SetZoomLevel = `-- name: SetZoomLevel :exec
89INSERT INTO zoom_levels (domain, zoom_factor, updated_at) 
90VALUES (?, ?, CURRENT_TIMESTAMP) 
91ON CONFLICT(domain) DO UPDATE SET 
92    zoom_factor = excluded.zoom_factor,
93    updated_at = excluded.updated_at
94`
95
96// Set or update zoom level for a domain with validation
97func (q *Queries) SetZoomLevel(ctx context.Context, domain string, zoomFactor float64) error {
98	_, err := q.db.ExecContext(ctx, SetZoomLevel, domain, zoomFactor)
99	return err
100}

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