services/card/sqlRepository.go   A
last analyzed

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 13
dl 0
loc 21
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A card.NewRepository 0 3 1
A card.SQLRepository.GetByID 0 2 1
1
package card
2
3
import (
4
	"context"
5
6
	"github.com/jackc/pgx/v5/pgxpool"
7
	db "github.com/memnix/memnix-rest/db/sqlc"
8
	"github.com/memnix/memnix-rest/domain"
9
)
10
11
type SQLRepository struct {
12
	q *db.Queries // q is the sqlc queries.
13
}
14
15
func NewRepository(dbConn *pgxpool.Pool) IRepository {
16
	q := db.New(dbConn)
17
	return &SQLRepository{q: q}
18
}
19
20
func (r SQLRepository) GetByID(_ context.Context, _ uint) (domain.Card, error) {
21
	return domain.Card{}, nil
22
}
23