reposqlc

package
v0.0.0-...-075c139 Latest Latest
Warning

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

Go to latest
Published: May 21, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BOOKS_ID         = "id"
	BOOKS_TITLE      = "title"
	BOOKS_YOP        = "yop"
	BOOKS_AUTHOR     = "author"
	BOOKS_ISBN       = "isbn"
	BOOKS_PAGE       = "page"
	BOOKS_CREATED_AT = "created_at"
	BOOKS_UPDATED_AT = "updated_at"
	BOOKS_DELETED_AT = "deleted_at"
)
View Source
const (
	ASC  = "ASC"
	DESC = "DESC"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	ID        pgtype.UUID
	Title     string
	Yop       int16
	Author    string
	Isbn      pgtype.Text
	Page      pgtype.Int4
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
	DeletedAt pgtype.Timestamptz
}

type BookCreateParams

type BookCreateParams struct {
	Title  string
	Yop    int16
	Author string
	Isbn   pgtype.Text
	Page   pgtype.Int4
}

type BookUpdateByIdParams

type BookUpdateByIdParams struct {
	Title  string
	Yop    int16
	Author string
	Isbn   pgtype.Text
	Page   pgtype.Int4
	ID     pgtype.UUID
}

type ColumnCustomParams

type ColumnCustomParams struct {
	ColumnName string
	Ascending  bool
	Limit      int
	Offset     int
}

type DBTX

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

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) BookCount

func (q *Queries) BookCount(ctx context.Context, title string) (int64, error)

func (*Queries) BookCreate

func (q *Queries) BookCreate(ctx context.Context, arg BookCreateParams) error

func (*Queries) BookDeleteById

func (q *Queries) BookDeleteById(ctx context.Context, id pgtype.UUID) error

func (*Queries) BookDetailById

func (q *Queries) BookDetailById(ctx context.Context, id pgtype.UUID) (Book, error)

func (*Queries) BookGetAll

func (q *Queries) BookGetAll(
	ctx context.Context,
	xtra ColumnCustomParams,
	title string,
) ([]Book, error)

func (*Queries) BookUpdateById

func (q *Queries) BookUpdateById(ctx context.Context, arg BookUpdateByIdParams) error

func (*Queries) WithTx

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

Jump to

Keyboard shortcuts

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