mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: expose application name via Appearance API (#9886)
This commit is contained in:
@@ -4066,6 +4066,17 @@ func (q *sqlQuerier) GetAppSecurityKey(ctx context.Context) (string, error) {
|
||||
return value, err
|
||||
}
|
||||
|
||||
const getApplicationName = `-- name: GetApplicationName :one
|
||||
SELECT value FROM site_configs WHERE key = 'application_name'
|
||||
`
|
||||
|
||||
func (q *sqlQuerier) GetApplicationName(ctx context.Context) (string, error) {
|
||||
row := q.db.QueryRowContext(ctx, getApplicationName)
|
||||
var value string
|
||||
err := row.Scan(&value)
|
||||
return value, err
|
||||
}
|
||||
|
||||
const getDERPMeshKey = `-- name: GetDERPMeshKey :one
|
||||
SELECT value FROM site_configs WHERE key = 'derp_mesh_key'
|
||||
`
|
||||
@@ -4178,6 +4189,16 @@ func (q *sqlQuerier) UpsertAppSecurityKey(ctx context.Context, value string) err
|
||||
return err
|
||||
}
|
||||
|
||||
const upsertApplicationName = `-- name: UpsertApplicationName :exec
|
||||
INSERT INTO site_configs (key, value) VALUES ('application_name', $1)
|
||||
ON CONFLICT (key) DO UPDATE SET value = $1 WHERE site_configs.key = 'application_name'
|
||||
`
|
||||
|
||||
func (q *sqlQuerier) UpsertApplicationName(ctx context.Context, value string) error {
|
||||
_, err := q.db.ExecContext(ctx, upsertApplicationName, value)
|
||||
return err
|
||||
}
|
||||
|
||||
const upsertDefaultProxy = `-- name: UpsertDefaultProxy :exec
|
||||
INSERT INTO site_configs (key, value)
|
||||
VALUES
|
||||
|
||||
Reference in New Issue
Block a user