Documentation ¶
Index ¶
- type DBQuerier
- func (q *DBQuerier) ArrayAggFirstName(ctx context.Context, authorID int32) ([]string, error)
- func (q *DBQuerier) DeleteAuthors(ctx context.Context) (pgconn.CommandTag, error)
- func (q *DBQuerier) DeleteAuthorsByFirstName(ctx context.Context, firstName string) (pgconn.CommandTag, error)
- func (q *DBQuerier) DeleteAuthorsByFullName(ctx context.Context, params DeleteAuthorsByFullNameParams) (pgconn.CommandTag, error)
- func (q *DBQuerier) FindAuthorByID(ctx context.Context, authorID int32) (FindAuthorByIDRow, error)
- func (q *DBQuerier) FindAuthorNames(ctx context.Context, authorID int32) ([]FindAuthorNamesRow, error)
- func (q *DBQuerier) FindAuthors(ctx context.Context, firstName string) ([]FindAuthorsRow, error)
- func (q *DBQuerier) FindFirstNames(ctx context.Context, authorID int32) ([]*string, error)
- func (q *DBQuerier) InsertAuthor(ctx context.Context, firstName string, lastName string) (int32, error)
- func (q *DBQuerier) InsertAuthorSuffix(ctx context.Context, params InsertAuthorSuffixParams) (InsertAuthorSuffixRow, error)
- func (q *DBQuerier) StringAggFirstName(ctx context.Context, authorID int32) (*string, error)
- type DeleteAuthorsByFullNameParams
- type FindAuthorByIDRow
- type FindAuthorNamesRow
- type FindAuthorsRow
- type InsertAuthorSuffixParams
- type InsertAuthorSuffixRow
- type Querier
- type QueryName
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 ¶
func NewQuerier(conn genericConn) *DBQuerier
NewQuerier creates a DBQuerier that implements Querier.
func (*DBQuerier) ArrayAggFirstName ¶
ArrayAggFirstName implements Querier.ArrayAggFirstName.
func (*DBQuerier) DeleteAuthors ¶
DeleteAuthors implements Querier.DeleteAuthors.
func (*DBQuerier) DeleteAuthorsByFirstName ¶
func (q *DBQuerier) DeleteAuthorsByFirstName(ctx context.Context, firstName string) (pgconn.CommandTag, error)
DeleteAuthorsByFirstName implements Querier.DeleteAuthorsByFirstName.
func (*DBQuerier) DeleteAuthorsByFullName ¶
func (q *DBQuerier) DeleteAuthorsByFullName(ctx context.Context, params DeleteAuthorsByFullNameParams) (pgconn.CommandTag, error)
DeleteAuthorsByFullName implements Querier.DeleteAuthorsByFullName.
func (*DBQuerier) FindAuthorByID ¶
FindAuthorByID implements Querier.FindAuthorByID.
func (*DBQuerier) FindAuthorNames ¶
func (q *DBQuerier) FindAuthorNames(ctx context.Context, authorID int32) ([]FindAuthorNamesRow, error)
FindAuthorNames implements Querier.FindAuthorNames.
func (*DBQuerier) FindAuthors ¶
FindAuthors implements Querier.FindAuthors.
func (*DBQuerier) FindFirstNames ¶
FindFirstNames implements Querier.FindFirstNames.
func (*DBQuerier) InsertAuthor ¶
func (q *DBQuerier) InsertAuthor(ctx context.Context, firstName string, lastName string) (int32, error)
InsertAuthor implements Querier.InsertAuthor.
func (*DBQuerier) InsertAuthorSuffix ¶
func (q *DBQuerier) InsertAuthorSuffix(ctx context.Context, params InsertAuthorSuffixParams) (InsertAuthorSuffixRow, error)
InsertAuthorSuffix implements Querier.InsertAuthorSuffix.
type FindAuthorByIDRow ¶
type FindAuthorNamesRow ¶
type FindAuthorsRow ¶
type InsertAuthorSuffixRow ¶
type Querier ¶
type Querier interface { // FindAuthorById finds one (or zero) authors by ID. FindAuthorByID(ctx context.Context, authorID int32) (FindAuthorByIDRow, error) // FindAuthors finds authors by first name. FindAuthors(ctx context.Context, firstName string) ([]FindAuthorsRow, error) // FindAuthorNames finds one (or zero) authors by ID. FindAuthorNames(ctx context.Context, authorID int32) ([]FindAuthorNamesRow, error) // FindFirstNames finds one (or zero) authors by ID. FindFirstNames(ctx context.Context, authorID int32) ([]*string, error) // DeleteAuthors deletes authors with a first name of "joe". DeleteAuthors(ctx context.Context) (pgconn.CommandTag, error) // DeleteAuthorsByFirstName deletes authors by first name. DeleteAuthorsByFirstName(ctx context.Context, firstName string) (pgconn.CommandTag, error) // DeleteAuthorsByFullName deletes authors by the full name. DeleteAuthorsByFullName(ctx context.Context, params DeleteAuthorsByFullNameParams) (pgconn.CommandTag, error) // InsertAuthor inserts an author by name and returns the ID. InsertAuthor(ctx context.Context, firstName string, lastName string) (int32, error) // InsertAuthorSuffix inserts an author by name and suffix and returns the // entire row. InsertAuthorSuffix(ctx context.Context, params InsertAuthorSuffixParams) (InsertAuthorSuffixRow, error) StringAggFirstName(ctx context.Context, authorID int32) (*string, error) ArrayAggFirstName(ctx context.Context, authorID int32) ([]string, error) }
Querier is a typesafe Go interface backed by SQL queries.