MCPcopy
hub / github.com/pocketbase/pocketbase / AliasOrIdentifier

Function AliasOrIdentifier

tools/dbutils/select.go:10–18  ·  view source on GitHub ↗

AliasOrIdentifier returns the alias from a column or table identifier. Returns the identifier unmodified if no alias was found.

(columnOrTableIdentifier string)

Source from the content-addressed store, hash-verified

8// AliasOrIdentifier returns the alias from a column or table identifier.
9// Returns the identifier unmodified if no alias was found.
10func AliasOrIdentifier(columnOrTableIdentifier string) string {
11 matches := selectRegex.FindStringSubmatch(columnOrTableIdentifier)
12
13 if len(matches) > 0 && matches[1] != "" {
14 return matches[1]
15 }
16
17 return columnOrTableIdentifier
18}

Callers 2

ExecMethod · 0.92
TestAliasOrIdentifierFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestAliasOrIdentifierFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…