// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.30.0 // source: favicon.sql package sqlc import ( "context" "database/sql" "time" ) const DeleteFavicon = `-- name: DeleteFavicon :exec DELETE FROM favicons WHERE key = ? ` func (q *Queries) DeleteFavicon(ctx context.Context, key string) error { _, err := q.db.ExecContext(ctx, DeleteFavicon, key) return err } const GetFavicon = `-- name: GetFavicon :one SELECT "key", source_url, page_url, source, content_hash, content_type, updated_at, last_checked_at FROM favicons WHERE key = ? LIMIT 1 ` func (q *Queries) GetFavicon(ctx context.Context, key string) (Favicon, error) { row := q.db.QueryRowContext(ctx, GetFavicon, key) var i Favicon err := row.Scan( &i.Key, &i.SourceUrl, &i.PageUrl, &i.Source, &i.ContentHash, &i.ContentType, &i.UpdatedAt, &i.LastCheckedAt, ) return i, err } const UpdateFaviconLastChecked = `-- name: UpdateFaviconLastChecked :exec UPDATE favicons SET content_hash = ?, last_checked_at = ? WHERE key = ? ` type UpdateFaviconLastCheckedParams struct { ContentHash string `json:"content_hash"` LastCheckedAt time.Time `json:"last_checked_at"` Key string `json:"key"` } func (q *Queries) UpdateFaviconLastChecked(ctx context.Context, arg UpdateFaviconLastCheckedParams) error { _, err := q.db.ExecContext(ctx, UpdateFaviconLastChecked, arg.ContentHash, arg.LastCheckedAt, arg.Key) return err } const UpsertFavicon = `-- name: UpsertFavicon :exec INSERT INTO favicons ( key, source_url, page_url, source, content_hash, content_type, updated_at, last_checked_at ) VALUES (?, ?, ?, ?, ?, ?, ?, ?) ON CONFLICT(key) DO UPDATE SET source_url = EXCLUDED.source_url, page_url = EXCLUDED.page_url, source = EXCLUDED.source, content_hash = EXCLUDED.content_hash, content_type = EXCLUDED.content_type, updated_at = EXCLUDED.updated_at, last_checked_at = EXCLUDED.last_checked_at ` type UpsertFaviconParams struct { Key string `json:"key"` SourceUrl sql.NullString `json:"source_url"` PageUrl sql.NullString `json:"page_url"` Source string `json:"source"` ContentHash string `json:"content_hash"` ContentType sql.NullString `json:"content_type"` UpdatedAt time.Time `json:"updated_at"` LastCheckedAt time.Time `json:"last_checked_at"` } func (q *Queries) UpsertFavicon(ctx context.Context, arg UpsertFaviconParams) error { _, err := q.db.ExecContext(ctx, UpsertFavicon, arg.Key, arg.SourceUrl, arg.PageUrl, arg.Source, arg.ContentHash, arg.ContentType, arg.UpdatedAt, arg.LastCheckedAt, ) return err }