Documentation
¶
Index ¶
- type DBQuerier
- func (q *DBQuerier) CountAuthors(ctx context.Context) (*int, error)
- func (q *DBQuerier) DeleteAuthorsByFullName(ctx context.Context, firstName string, lastName string, suffix string) (pgconn.CommandTag, error)
- func (q *DBQuerier) FindAuthorByID(ctx context.Context, authorID int32) (FindAuthorByIDRow, error)
- func (q *DBQuerier) InsertAuthor(ctx context.Context, firstName string, lastName string) (int32, error)
- type FindAuthorByIDRow
- type Querier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBQuerier ¶
type DBQuerier struct {
// contains filtered or unexported fields
}
func NewQuerier ¶
NewQuerier creates a DBQuerier that implements Querier.
func (*DBQuerier) CountAuthors ¶
CountAuthors implements Querier.CountAuthors.
func (*DBQuerier) DeleteAuthorsByFullName ¶
func (q *DBQuerier) DeleteAuthorsByFullName(ctx context.Context, firstName string, lastName string, suffix string) (pgconn.CommandTag, error)
DeleteAuthorsByFullName implements Querier.DeleteAuthorsByFullName.
func (*DBQuerier) FindAuthorByID ¶
FindAuthorByID implements Querier.FindAuthorByID.
type FindAuthorByIDRow ¶
type Querier ¶
type Querier interface { // CountAuthors returns the number of authors (zero params). CountAuthors(ctx context.Context) (*int, error) // FindAuthorById finds one (or zero) authors by ID (one param). FindAuthorByID(ctx context.Context, authorID int32) (FindAuthorByIDRow, error) // InsertAuthor inserts an author by name and returns the ID (two params). InsertAuthor(ctx context.Context, firstName string, lastName string) (int32, error) // DeleteAuthorsByFullName deletes authors by the full name (three params). DeleteAuthorsByFullName(ctx context.Context, firstName string, lastName string, suffix string) (pgconn.CommandTag, error) }
Querier is a typesafe Go interface backed by SQL queries.
Click to show internal directories.
Click to hide internal directories.