Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions backend/internal/cleanup/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@ import (

"github.com/google/uuid"
"github.com/jackc/pgx/v5"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/jackc/pgx/v5/pgconn"
)

// DBPool defines the interface for database operations
type DBPool interface {
Exec(ctx context.Context, sql string, arguments ...interface{}) (pgconn.CommandTag, error)
Query(ctx context.Context, sql string, args ...interface{}) (pgx.Rows, error)
QueryRow(ctx context.Context, sql string, args ...interface{}) pgx.Row
}

// Repository defines the cleanup repository interface
type Repository interface {
// Job operations
Expand Down Expand Up @@ -100,11 +107,11 @@ type JobFilters struct {

// repository implements the Repository interface
type repository struct {
db *pgxpool.Pool
db DBPool
}

// NewRepository creates a new cleanup repository
func NewRepository(db *pgxpool.Pool) Repository {
func NewRepository(db DBPool) Repository {
return &repository{db: db}
}

Expand Down
Loading
Loading