model

package
v0.0.0-...-3fab713 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	ID        int32
	Name      string
	BirthDate sql.NullTime
}

type Book

type Book struct {
	ID              int32
	Title           string
	PublicationDate sql.NullTime
	AuthorID        int32
}

type CreateAuthorParams

type CreateAuthorParams struct {
	Name      string
	BirthDate sql.NullTime
}

type CreateBookParams

type CreateBookParams struct {
	Title           string
	PublicationDate sql.NullTime
	AuthorID        int32
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetAuthorsBornWithinParams

type GetAuthorsBornWithinParams struct {
	StartTime sql.NullTime
	EndTime   sql.NullTime
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreateAuthor

func (q *Queries) CreateAuthor(ctx context.Context, arg CreateAuthorParams) (Author, error)

func (*Queries) CreateBook

func (q *Queries) CreateBook(ctx context.Context, arg CreateBookParams) (Book, error)

func (*Queries) GetAuthorByID

func (q *Queries) GetAuthorByID(ctx context.Context, id int32) (Author, error)

func (*Queries) GetAuthorByName

func (q *Queries) GetAuthorByName(ctx context.Context, name string) (Author, error)

func (*Queries) GetAuthorsBornWithin

func (q *Queries) GetAuthorsBornWithin(ctx context.Context, arg GetAuthorsBornWithinParams) ([]Author, error)

func (*Queries) GetBookByID

func (q *Queries) GetBookByID(ctx context.Context, id int32) (Book, error)

func (*Queries) GetBookByTitle

func (q *Queries) GetBookByTitle(ctx context.Context, title string) (Book, error)

func (*Queries) GetBooksByAuthorName

func (q *Queries) GetBooksByAuthorName(ctx context.Context, name string) ([]Book, error)

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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