sqlc

package
v0.0.0-...-04a0fa3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateMovieParams

type CreateMovieParams struct {
	Title       string         `json:"title"`
	Description pgtype.Text    `json:"description"`
	ReleaseYear int32          `json:"release_year"`
	Genre       []string       `json:"genre"`
	Director    pgtype.Text    `json:"director"`
	Rating      pgtype.Numeric `json:"rating"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...any) (pgconn.CommandTag, error)
	Query(context.Context, string, ...any) (pgx.Rows, error)
	QueryRow(context.Context, string, ...any) pgx.Row
}

type ListMoviesParams

type ListMoviesParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Movie

type Movie struct {
	ID          int64          `json:"id"`
	Title       string         `json:"title"`
	Description pgtype.Text    `json:"description"`
	ReleaseYear int32          `json:"release_year"`
	Genre       []string       `json:"genre"`
	Director    pgtype.Text    `json:"director"`
	Rating      pgtype.Numeric `json:"rating"`
}

type Querier

type Querier interface {
	CreateMovie(ctx context.Context, arg CreateMovieParams) (Movie, error)
	DeleteMovie(ctx context.Context, id int64) error
	GetMovieByID(ctx context.Context, id int64) (Movie, error)
	ListMovies(ctx context.Context, arg ListMoviesParams) ([]Movie, error)
	UpdateMovie(ctx context.Context, arg UpdateMovieParams) (Movie, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateMovie

func (q *Queries) CreateMovie(ctx context.Context, arg CreateMovieParams) (Movie, error)

func (*Queries) DeleteMovie

func (q *Queries) DeleteMovie(ctx context.Context, id int64) error

func (*Queries) GetMovieByID

func (q *Queries) GetMovieByID(ctx context.Context, id int64) (Movie, error)

func (*Queries) ListMovies

func (q *Queries) ListMovies(ctx context.Context, arg ListMoviesParams) ([]Movie, error)

func (*Queries) UpdateMovie

func (q *Queries) UpdateMovie(ctx context.Context, arg UpdateMovieParams) (Movie, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type UpdateMovieParams

type UpdateMovieParams struct {
	ID          int64          `json:"id"`
	Title       string         `json:"title"`
	Description pgtype.Text    `json:"description"`
	ReleaseYear int32          `json:"release_year"`
	Genre       []string       `json:"genre"`
	Director    pgtype.Text    `json:"director"`
	Rating      pgtype.Numeric `json:"rating"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL