authors

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 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   int64
	Name string
	Bio  sql.NullString
}

type CreateAuthorParams

type CreateAuthorParams struct {
	Name string
	Bio  sql.NullString
}

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 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) DeleteAuthor

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

func (*Queries) GetAuthor

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

func (*Queries) ListAuthors

func (q *Queries) ListAuthors(ctx context.Context) ([]Author, 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