feat(store): sqlc-запросы, dto TemplateDoc, Repository, интеграционные тесты CRUD

This commit is contained in:
2026-07-03 14:08:37 +07:00
parent 9c29d40269
commit 34bc49ee8c
15 changed files with 757 additions and 0 deletions
+20
View File
@@ -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 }