Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Open ¶
Open opens a database specified by the data source name. Format: host=foo port=5432 user=bar password=baz dbname=qux sslmode=disable"
func StringPtrToNullString ¶
func StringPtrToNullString(s *string) sql.NullString
StringPtrToNullString converts *string to sql.NullString.
Types ¶
type Repository ¶
type Repository interface { // agent queries CreateAgent(ctx context.Context, arg sqlc.CreateAgentParams) (sqlc.Agent, error) DeleteAgent(ctx context.Context, id int64) (sqlc.Agent, error) GetAgent(ctx context.Context, id int64) (sqlc.Agent, error) ListAgents(ctx context.Context) ([]sqlc.Agent, error) UpdateAgent(ctx context.Context, arg sqlc.UpdateAgentParams) (sqlc.Agent, error) ListAgentsByAuthorIDs(ctx context.Context, authorIDs []int64) ([]sqlc.ListAgentsByAuthorIDsRow, error) // author queries CreateAuthor(ctx context.Context, arg sqlc.CreateAuthorParams) (sqlc.Author, error) DeleteAuthor(ctx context.Context, id int64) (sqlc.Author, error) GetAuthor(ctx context.Context, id int64) (sqlc.Author, error) ListAuthors(ctx context.Context) ([]sqlc.Author, error) UpdateAuthor(ctx context.Context, arg sqlc.UpdateAuthorParams) (sqlc.Author, error) ListAuthorsByAgentIDs(ctx context.Context, agentIDs []int64) ([]sqlc.Author, error) ListAuthorsByBookIDs(ctx context.Context, bookIDs []int64) ([]sqlc.ListAuthorsByBookIDsRow, error) // book queries CreateBook(ctx context.Context, bookArg sqlc.CreateBookParams, authorIDs []int64) (*sqlc.Book, error) UpdateBook(ctx context.Context, bookArg sqlc.UpdateBookParams, authorIDs []int64) (*sqlc.Book, error) DeleteBook(ctx context.Context, id int64) (sqlc.Book, error) GetBook(ctx context.Context, id int64) (sqlc.Book, error) ListBooks(ctx context.Context) ([]sqlc.Book, error) ListBooksByAuthorIDs(ctx context.Context, authorIDs []int64) ([]sqlc.ListBooksByAuthorIDsRow, error) }
Repository is the application's data layer functionality.
func NewRepository ¶
func NewRepository(db *sql.DB) Repository
NewRepository returns an implementation of the Repository interface.
Click to show internal directories.
Click to hide internal directories.