mirror of
https://github.com/lorsanstand/HomeOps-Hub.git
synced 2026-06-19 16:45:15 +03:00
22 lines
414 B
Go
22 lines
414 B
Go
package store
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
"github.com/lorsanstand/HomeOps-Hub/internal/hub/store/sqlc/gen"
|
|
)
|
|
|
|
type HubStore struct {
|
|
queries *gen.Queries
|
|
}
|
|
|
|
func NewHubStore(db *pgxpool.Pool) *HubStore {
|
|
queries := gen.New(db)
|
|
return &HubStore{queries}
|
|
}
|
|
|
|
func (h *HubStore) NewAgent(ctx context.Context, agent Agent) error {
|
|
return h.queries.CreateAgent(ctx, toDBAgent(agent))
|
|
}
|