// Code generated by sqlc. DO NOT EDIT. // versions: // sqlc v1.30.0 // source: subscriptions.sql package repository import ( "context" "github.com/jackc/pgx/v5/pgtype" ) const createCalendarSubscription = `-- name: CreateCalendarSubscription :one INSERT INTO calendar_subscriptions (id, calendar_id, source_url) VALUES ($1, $2, $3) RETURNING id, calendar_id, source_url, last_synced_at, created_at ` type CreateCalendarSubscriptionParams struct { ID pgtype.UUID `json:"id"` CalendarID pgtype.UUID `json:"calendar_id"` SourceUrl string `json:"source_url"` } func (q *Queries) CreateCalendarSubscription(ctx context.Context, arg CreateCalendarSubscriptionParams) (CalendarSubscription, error) { row := q.db.QueryRow(ctx, createCalendarSubscription, arg.ID, arg.CalendarID, arg.SourceUrl) var i CalendarSubscription err := row.Scan( &i.ID, &i.CalendarID, &i.SourceUrl, &i.LastSyncedAt, &i.CreatedAt, ) return i, err } const getSubscriptionByCalendar = `-- name: GetSubscriptionByCalendar :one SELECT id, calendar_id, source_url, last_synced_at, created_at FROM calendar_subscriptions WHERE calendar_id = $1 ` func (q *Queries) GetSubscriptionByCalendar(ctx context.Context, calendarID pgtype.UUID) (CalendarSubscription, error) { row := q.db.QueryRow(ctx, getSubscriptionByCalendar, calendarID) var i CalendarSubscription err := row.Scan( &i.ID, &i.CalendarID, &i.SourceUrl, &i.LastSyncedAt, &i.CreatedAt, ) return i, err }