refactor: migrate to sqlite

This commit is contained in:
2026-05-05 20:32:29 +03:00
parent 91c49fb563
commit 4988aacc56
13 changed files with 207 additions and 126 deletions
+3 -3
View File
@@ -2,8 +2,8 @@ package store
import (
"context"
"database/sql"
"github.com/jackc/pgx/v5/pgxpool"
domainHub "github.com/lorsanstand/HomeOps-Hub/hub/internal/domain"
"github.com/lorsanstand/HomeOps-Hub/hub/internal/store/sqlc/gen"
)
@@ -12,7 +12,7 @@ type HubStore struct {
queries *gen.Queries
}
func NewHubStore(db *pgxpool.Pool) *HubStore {
func NewHubStore(db *sql.DB) *HubStore {
queries := gen.New(db)
return &HubStore{queries}
}
@@ -31,6 +31,6 @@ func (h *HubStore) GetAgentByAgentID(ctx context.Context, AgentID string) (domai
func (h *HubStore) UpdateAgentByID(ctx context.Context, ID int, updateAgent domainHub.CreateAgentModel) error {
data := toUpdateDBAgent(updateAgent)
data.ID = int32(ID)
data.ID = int64(ID)
return h.queries.UpdateAgentByID(ctx, data)
}