generate identity

This commit is contained in:
venture
2026-11-13 21:49:09 +01:00
parent 4da2fe9424
commit 7ebe8962dd
9 changed files with 689 additions and 5 deletions
+23
View File
@@ -282,6 +282,29 @@ func (q *Queries) GetAccountByLoginKey(ctx context.Context, loginKey string) (Ac
return i, err
}
const getClusterPrincipal = `-- name: GetClusterPrincipal :one
SELECT id, kind, name, public_key, status, successor_id, created_at, disabled_at
FROM principal
WHERE kind = 'cluster'
LIMIT 1
`
func (q *Queries) GetClusterPrincipal(ctx context.Context) (Principal, error) {
row := q.db.QueryRowContext(ctx, getClusterPrincipal)
var i Principal
err := row.Scan(
&i.ID,
&i.Kind,
&i.Name,
&i.PublicKey,
&i.Status,
&i.SuccessorID,
&i.CreatedAt,
&i.DisabledAt,
)
return i, err
}
const getMembership = `-- name: GetMembership :one
SELECT group_id, member_id, role, created_at
FROM membership