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
+36
View File
@@ -0,0 +1,36 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.31.1
// source: check_runs.sql
package db
import (
"context"
"github.com/jackc/pgx/v5/pgtype"
)
const createCheckRun = `-- name: CreateCheckRun :one
INSERT INTO check_runs (id, domain_id, result)
VALUES ($1, $2, $3)
RETURNING id, domain_id, result, created_at
`
type CreateCheckRunParams struct {
ID pgtype.UUID `json:"id"`
DomainID pgtype.UUID `json:"domain_id"`
Result []byte `json:"result"`
}
func (q *Queries) CreateCheckRun(ctx context.Context, arg CreateCheckRunParams) (CheckRun, error) {
row := q.db.QueryRow(ctx, createCheckRun, arg.ID, arg.DomainID, arg.Result)
var i CheckRun
err := row.Scan(
&i.ID,
&i.DomainID,
&i.Result,
&i.CreatedAt,
)
return i, err
}