#7 - saving feed, but without content

This commit is contained in:
2025-03-11 13:57:16 +02:00
parent 5a7fac748b
commit e89bfba392
6 changed files with 140 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.28.0
// source: createFeed.sql
package database
import (
"context"
"time"
"github.com/google/uuid"
)
const createFeed = `-- name: CreateFeed :one
INSERT INTO feeds (id, created_at, updated_at, user_id, url, name)
VALUES (
$1,
$2,
$3,
$4,
$5,
$6
)
RETURNING id, created_at, updated_at, name, url, user_id
`
type CreateFeedParams struct {
ID uuid.UUID
CreatedAt time.Time
UpdatedAt time.Time
UserID uuid.UUID
Url string
Name string
}
func (q *Queries) CreateFeed(ctx context.Context, arg CreateFeedParams) (Feed, error) {
row := q.db.QueryRowContext(ctx, createFeed,
arg.ID,
arg.CreatedAt,
arg.UpdatedAt,
arg.UserID,
arg.Url,
arg.Name,
)
var i Feed
err := row.Scan(
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.Name,
&i.Url,
&i.UserID,
)
return i, err
}