feat(tmpl): {{domain_name}} placeholder — materialize on diff/apply, parameterize on snapshot
Adds internal/tmpl with Materialize (template placeholder -> zone name) and Parameterize (zone name -> placeholder, the inverse used by the template-from-zone snapshot). service.resolve now materializes the template against DomainRef.ZoneName before diffing, so one template can be reused across domains. LoadDomainFull (source query + hand-edited sqlc output, since sqlc is not installed) now also selects zone_name to populate it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BwxdSt4reTm7Dj1oxRvpP3
This commit is contained in:
@@ -184,7 +184,7 @@ func (q *Queries) ListDomains(ctx context.Context, projectID uuid.UUID) ([]Domai
|
||||
}
|
||||
|
||||
const loadDomainFull = `-- name: LoadDomainFull :one
|
||||
SELECT d.zone_id, a.provider, a.secret_enc, t.doc
|
||||
SELECT d.zone_id, d.zone_name, a.provider, a.secret_enc, t.doc
|
||||
FROM domains d
|
||||
JOIN provider_accounts a ON a.id = d.provider_account_id
|
||||
LEFT JOIN templates t ON t.id = d.template_id
|
||||
@@ -198,6 +198,7 @@ type LoadDomainFullParams struct {
|
||||
|
||||
type LoadDomainFullRow struct {
|
||||
ZoneID string `json:"zone_id"`
|
||||
ZoneName string `json:"zone_name"`
|
||||
Provider string `json:"provider"`
|
||||
SecretEnc string `json:"secret_enc"`
|
||||
Doc *dto.TemplateDoc `json:"doc"`
|
||||
@@ -208,6 +209,7 @@ func (q *Queries) LoadDomainFull(ctx context.Context, arg LoadDomainFullParams)
|
||||
var i LoadDomainFullRow
|
||||
err := row.Scan(
|
||||
&i.ZoneID,
|
||||
&i.ZoneName,
|
||||
&i.Provider,
|
||||
&i.SecretEnc,
|
||||
&i.Doc,
|
||||
|
||||
Reference in New Issue
Block a user