Documentation ¶
Index ¶
- func Open(c config.DB) (*sql.DB, error)
- type Comment
- type CreateCommentParams
- type CreatePostParams
- type CreateUserParams
- type DBTX
- type Post
- type Querier
- type Queries
- func (q *Queries) CreateComment(ctx context.Context, arg CreateCommentParams) (Comment, error)
- func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (Post, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteComment(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeletePost(ctx context.Context, id uuid.UUID) error
- func (q *Queries) GetAllCommentsForPost(ctx context.Context, postID uuid.UUID) ([]Comment, error)
- func (q *Queries) GetAllPosts(ctx context.Context) ([]Post, error)
- func (q *Queries) GetPostByID(ctx context.Context, id uuid.UUID) (Post, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) UpdateComment(ctx context.Context, arg UpdateCommentParams) (Comment, error)
- func (q *Queries) UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SchemaMigration
- type Session
- type UpdateCommentParams
- type UpdatePostParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CreateCommentParams ¶
type CreatePostParams ¶
type CreateUserParams ¶
type Querier ¶
type Querier interface { // Inserts a new comment into the comments table CreateComment(ctx context.Context, arg CreateCommentParams) (Comment, error) // Inserts a new post into the posts table CreatePost(ctx context.Context, arg CreatePostParams) (Post, error) // Inserts a new user into the users table CreateUser(ctx context.Context, arg CreateUserParams) (User, error) // Deletes a specific comment from the comments table by ID DeleteComment(ctx context.Context, id uuid.UUID) error // Deletes a specific post from the posts table by ID DeletePost(ctx context.Context, id uuid.UUID) error // Retrieves all comments for a specific post from the comments table GetAllCommentsForPost(ctx context.Context, postID uuid.UUID) ([]Comment, error) // Retrieves all posts from the posts table GetAllPosts(ctx context.Context) ([]Post, error) // Retrieves a specific post from the posts table by ID GetPostByID(ctx context.Context, id uuid.UUID) (Post, error) // Retrieves user by email (used for login) GetUserByEmail(ctx context.Context, email string) (User, error) // Updates a specific comment in the comments table by ID UpdateComment(ctx context.Context, arg UpdateCommentParams) (Comment, error) // Updates a specific post in the posts table by ID UpdatePost(ctx context.Context, arg UpdatePostParams) (Post, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateComment ¶
Inserts a new comment into the comments table
func (*Queries) CreatePost ¶
Inserts a new post into the posts table
func (*Queries) CreateUser ¶
Inserts a new user into the users table
func (*Queries) DeleteComment ¶
Deletes a specific comment from the comments table by ID
func (*Queries) DeletePost ¶
Deletes a specific post from the posts table by ID
func (*Queries) GetAllCommentsForPost ¶
Retrieves all comments for a specific post from the comments table
func (*Queries) GetAllPosts ¶
Retrieves all posts from the posts table
func (*Queries) GetPostByID ¶
Retrieves a specific post from the posts table by ID
func (*Queries) GetUserByEmail ¶
Retrieves user by email (used for login)
func (*Queries) UpdateComment ¶
Updates a specific comment in the comments table by ID
func (*Queries) UpdatePost ¶
Updates a specific post in the posts table by ID
type SchemaMigration ¶
type SchemaMigration struct {
Version string
}
type UpdateCommentParams ¶
Click to show internal directories.
Click to hide internal directories.