more updates
Publish Action Image / build (push) Successful in 1m8s

This commit is contained in:
2026-06-29 15:14:55 +10:00
parent 01223c176f
commit 4ee1b9e13c
15 changed files with 1155 additions and 832 deletions
+17
View File
@@ -119,3 +119,20 @@ func Slug(s string) string {
func HostSlug(hostname string) string {
return Slug(strings.ReplaceAll(hostname, ".", "-"))
}
// PGIdentifier converts a kforge name into a valid unquoted
// PostgreSQL identifier: lowercase, hyphens and spaces become
// underscores, all other non-alphanumeric characters are dropped.
// "prod-my-tenant-myapp" → "prod_my_tenant_myapp"
func PGIdentifier(s string) string {
var b strings.Builder
for _, r := range strings.ToLower(s) {
switch {
case r >= 'a' && r <= 'z', r >= '0' && r <= '9', r == '_':
b.WriteRune(r)
case r == '-', r == ' ':
b.WriteRune('_')
}
}
return strings.Trim(b.String(), "_")
}