hiling_go/db/sqlc/news_events.sql.go
2024-08-19 07:40:01 +07:00

42 lines
823 B
Go
Executable File

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.26.0
// source: news_events.sql
package db
import (
"context"
"github.com/jackc/pgx/v5/pgtype"
)
const createNewsEvents = `-- name: CreateNewsEvents :exec
INSERT INTO news_events(
title,
url,
source,
description,
submitted_by
) VALUES ( $1, $2, $3, $4, $5)
`
type CreateNewsEventsParams struct {
Title string `json:"title"`
Url string `json:"url"`
Source string `json:"source"`
Description pgtype.Text `json:"description"`
SubmittedBy int32 `json:"submitted_by"`
}
func (q *Queries) CreateNewsEvents(ctx context.Context, arg CreateNewsEventsParams) error {
_, err := q.db.Exec(ctx, createNewsEvents,
arg.Title,
arg.Url,
arg.Source,
arg.Description,
arg.SubmittedBy,
)
return err
}