MCPcopy Index your code
hub / github.com/rilldata/rill / isValidAttributeKey

Function isValidAttributeKey

admin/database/postgres/postgres.go:4101–4111  ·  view source on GitHub ↗

isValidAttributeKey checks if an attribute key contains only alphanumeric characters and underscores

(key string)

Source from the content-addressed store, hash-verified

4099
4100// isValidAttributeKey checks if an attribute key contains only alphanumeric characters and underscores
4101func isValidAttributeKey(key string) bool {
4102 if key == "" {
4103 return false
4104 }
4105 for _, r := range key {
4106 if !((r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9') || r == '_') {
4107 return false
4108 }
4109 }
4110 return true
4111}
4112
4113func marshalResourceNames(resources []database.ResourceName) ([]byte, error) {
4114 resources = dedupeAndSortResourceNames(resources)

Callers 1

validateAttributesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected