#12 - update feeds

This commit is contained in:
2025-03-11 15:25:52 +02:00
parent a76915c7fc
commit f561eb4c34
10 changed files with 131 additions and 22 deletions

View File

@@ -0,0 +1,32 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.28.0
// source: markFeeedFetched.sql
package database
import (
"context"
"github.com/google/uuid"
)
const markFeedFetched = `-- name: MarkFeedFetched :one
UPDATE feeds SET last_fetched_at = CURRENT_TIMESTAMP, updated_at = CURRENT_TIMESTAMP WHERE id = $1
RETURNING id, created_at, updated_at, name, url, user_id, last_fetched_at
`
func (q *Queries) MarkFeedFetched(ctx context.Context, id uuid.UUID) (Feed, error) {
row := q.db.QueryRowContext(ctx, markFeedFetched, id)
var i Feed
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.Name,
&i.Url,
&i.UserID,
&i.LastFetchedAt,
)
return i, err
}