Versions in this module Expand all Collapse all v2 v2.0.2 Jun 23, 2025 v2.0.1 Jun 13, 2025 Changes in this version + type PostgresProvider struct + func NewPostgresProvider(db *sqlx.DB) *PostgresProvider + func (p *PostgresProvider) Close() error + func (p *PostgresProvider) GetCommentRepository() repository.CommentRepository + func (p *PostgresProvider) Health() error + func (p *PostgresProvider) Migrate() error + type PostgresRepository struct + func (r *PostgresRepository) BeginTx(ctx context.Context) (repository.Repository, error) + func (r *PostgresRepository) CommitTx(ctx context.Context) error + func (r *PostgresRepository) CreateComment(ctx context.Context, comment *models.Comment) error + func (r *PostgresRepository) CreateVote(ctx context.Context, vote *models.Vote) error + func (r *PostgresRepository) DeleteComment(ctx context.Context, id string, userID string) error + func (r *PostgresRepository) DeleteVote(ctx context.Context, commentID, userID string) error + func (r *PostgresRepository) GetCommentByID(ctx context.Context, id string) (*models.Comment, error) + func (r *PostgresRepository) GetCommentChildren(ctx context.Context, parentID string, maxDepth int) ([]*models.Comment, error) + func (r *PostgresRepository) GetCommentPath(ctx context.Context, commentID string) ([]*models.Comment, error) + func (r *PostgresRepository) GetCommentStats(ctx context.Context, rootID string) (*models.CommentStats, error) + func (r *PostgresRepository) GetCommentTree(ctx context.Context, rootID string, maxDepth int, sortBy string) ([]*models.CommentTree, error) + func (r *PostgresRepository) GetCommentVotes(ctx context.Context, commentID string) ([]*models.Vote, error) + func (r *PostgresRepository) GetComments(ctx context.Context, filter *models.CommentFilter) ([]*models.Comment, error) + func (r *PostgresRepository) GetCommentsByRootID(ctx context.Context, rootID string, filter *models.CommentFilter) ([]*models.Comment, error) + func (r *PostgresRepository) GetCommentsByUserID(ctx context.Context, userID string, filter *models.CommentFilter) ([]*models.Comment, error) + func (r *PostgresRepository) GetCommentsWithUserVotes(ctx context.Context, rootID, userID string, filter *models.CommentFilter) ([]*models.Comment, map[string]*models.Vote, error) + func (r *PostgresRepository) GetTopComments(ctx context.Context, rootID string, limit int, timeRange string) ([]*models.Comment, error) + func (r *PostgresRepository) GetUserCommentCount(ctx context.Context, userID string) (int64, error) + func (r *PostgresRepository) GetUserVote(ctx context.Context, commentID, userID string) (*models.Vote, error) + func (r *PostgresRepository) PurgeDeletedComments(ctx context.Context, olderThan int) (int64, error) + func (r *PostgresRepository) RecalculateCommentScores(ctx context.Context) error + func (r *PostgresRepository) RollbackTx(ctx context.Context) error + func (r *PostgresRepository) UpdateComment(ctx context.Context, id string, updates *models.UpdateCommentRequest) error + func (r *PostgresRepository) UpdateCommentScores(ctx context.Context, commentIDs []string) error + func (r *PostgresRepository) UpdateVote(ctx context.Context, commentID, userID string, voteType models.VoteType) error