Documentation
¶
Index ¶
- Constants
- func InitDB(dbPath string) (*sql.DB, error)
- func InitDBWithConfig(dbPath string, cfg *config.Config) (*sql.DB, error)
- type DBTX
- type DatabaseQuerier
- type History
- type HistoryQuerier
- type Querier
- type Queries
- func (q *Queries) AddOrUpdateHistory(ctx context.Context, url string, title sql.NullString) error
- func (q *Queries) CleanupOldZoomLevels(ctx context.Context, dollar_1 sql.NullString) error
- func (q *Queries) DeleteZoomLevel(ctx context.Context, domain string) error
- func (q *Queries) GetHistory(ctx context.Context, limit int64) ([]History, error)
- func (q *Queries) GetShortcuts(ctx context.Context) ([]Shortcut, error)
- func (q *Queries) GetZoomLevel(ctx context.Context, domain string) (float64, error)
- func (q *Queries) GetZoomLevelWithDefault(ctx context.Context, domain string) (interface{}, error)
- func (q *Queries) ListZoomLevels(ctx context.Context) ([]ZoomLevel, error)
- func (q *Queries) SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, ...) ([]History, error)
- func (q *Queries) SetZoomLevel(ctx context.Context, domain string, zoomFactor float64) error
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type Shortcut
- type ShortcutQuerier
- type ZoomLevel
- type ZoomQuerier
Constants ¶
View Source
const AddOrUpdateHistory = `` /* 215-byte string literal not displayed */
View Source
const CleanupOldZoomLevels = `-- name: CleanupOldZoomLevels :exec
DELETE FROM zoom_levels WHERE updated_at < datetime('now', '-' || ? || ' days')
`
View Source
const DeleteZoomLevel = `-- name: DeleteZoomLevel :exec
DELETE FROM zoom_levels WHERE domain = ?
`
View Source
const GetHistory = `` /* 135-byte string literal not displayed */
View Source
const GetShortcuts = `-- name: GetShortcuts :many
SELECT id, shortcut, url_template, description, created_at
FROM shortcuts
ORDER BY shortcut
`
View Source
const GetZoomLevel = `-- name: GetZoomLevel :one
SELECT zoom_factor FROM zoom_levels WHERE domain = ? LIMIT 1
`
View Source
const GetZoomLevelWithDefault = `` /* 148-byte string literal not displayed */
View Source
const ListZoomLevels = `-- name: ListZoomLevels :many
SELECT domain, zoom_factor, updated_at FROM zoom_levels ORDER BY updated_at DESC
`
View Source
const SearchHistory = `` /* 218-byte string literal not displayed */
View Source
const SetZoomLevel = `` /* 233-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DatabaseQuerier ¶
type DatabaseQuerier interface {
ZoomQuerier
HistoryQuerier
ShortcutQuerier
}
DatabaseQuerier combines all database operation interfaces
type HistoryQuerier ¶
type HistoryQuerier interface {
GetHistory(ctx context.Context, limit int64) ([]History, error)
SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, limit int64) ([]History, error)
AddOrUpdateHistory(ctx context.Context, url string, title sql.NullString) error
}
HistoryQuerier defines the interface for history-related database operations
type Querier ¶
type Querier interface {
AddOrUpdateHistory(ctx context.Context, url string, title sql.NullString) error
// Cleanup zoom level entries older than specified days
CleanupOldZoomLevels(ctx context.Context, dollar_1 sql.NullString) error
// Delete zoom level setting for a domain
DeleteZoomLevel(ctx context.Context, domain string) error
GetHistory(ctx context.Context, limit int64) ([]History, error)
GetShortcuts(ctx context.Context) ([]Shortcut, error)
// Get zoom level for a specific domain
GetZoomLevel(ctx context.Context, domain string) (float64, error)
// Get zoom level for domain with default fallback
GetZoomLevelWithDefault(ctx context.Context, domain string) (interface{}, error)
// List all zoom level settings ordered by most recently updated
ListZoomLevels(ctx context.Context) ([]ZoomLevel, error)
SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, limit int64) ([]History, error)
// Set or update zoom level for a domain with validation
SetZoomLevel(ctx context.Context, domain string, zoomFactor float64) error
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddOrUpdateHistory ¶
func (*Queries) CleanupOldZoomLevels ¶
Cleanup zoom level entries older than specified days
func (*Queries) DeleteZoomLevel ¶
Delete zoom level setting for a domain
func (*Queries) GetHistory ¶
func (*Queries) GetShortcuts ¶
func (*Queries) GetZoomLevel ¶
Get zoom level for a specific domain
func (*Queries) GetZoomLevelWithDefault ¶
Get zoom level for domain with default fallback
func (*Queries) ListZoomLevels ¶
List all zoom level settings ordered by most recently updated
func (*Queries) SearchHistory ¶
func (q *Queries) SearchHistory(ctx context.Context, column1 sql.NullString, column2 sql.NullString, limit int64) ([]History, error)
func (*Queries) SetZoomLevel ¶
Set or update zoom level for a domain with validation
type ShortcutQuerier ¶
ShortcutQuerier defines the interface for shortcut-related database operations
type ZoomQuerier ¶
type ZoomQuerier interface {
GetZoomLevel(ctx context.Context, domain string) (float64, error)
SetZoomLevel(ctx context.Context, domain string, zoomLevel float64) error
DeleteZoomLevel(ctx context.Context, domain string) error
}
ZoomQuerier defines the interface for zoom-related database operations
Source Files
¶
Click to show internal directories.
Click to hide internal directories.