feat(store): sqlc-запросы, dto TemplateDoc, Repository, интеграционные тесты CRUD
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
|
||||
"github.com/vasyakrg/dns-autoresolver/internal/store/db"
|
||||
)
|
||||
|
||||
// Store wraps sqlc-generated queries over a pgx pool.
|
||||
type Store struct {
|
||||
q *db.Queries
|
||||
pool *pgxpool.Pool
|
||||
}
|
||||
|
||||
func New(pool *pgxpool.Pool) *Store {
|
||||
return &Store{q: db.New(pool), pool: pool}
|
||||
}
|
||||
|
||||
// Queries exposes the generated queries for callers that need them directly.
|
||||
func (s *Store) Queries() *db.Queries { return s.q }
|
||||
Reference in New Issue
Block a user