MCPcopy Index your code
hub / github.com/coder/coder / SQLString

Method SQLString

coderd/rbac/regosql/acl_mapping_var.go:112–120  ·  view source on GitHub ↗
(cfg *sqltypes.SQLGenerator)

Source from the content-addressed store, hash-verified

110}
111
112func (g ACLMappingVar) SQLString(cfg *sqltypes.SQLGenerator) string {
113 if g.Subfield != "" {
114 // We can't use subsequent -> operators because the first one might return
115 // NULL, which would result in an error like "column does not exist"' from
116 // the second.
117 return fmt.Sprintf("%s#>array[%s, '%s']", g.SelectSQL, g.GroupNode.SQLString(cfg), g.Subfield)
118 }
119 return fmt.Sprintf("%s->%s", g.SelectSQL, g.GroupNode.SQLString(cfg))
120}
121
122func (g ACLMappingVar) ContainsSQL(cfg *sqltypes.SQLGenerator, other sqltypes.Node) (string, error) {
123 switch other.UseAs().(type) {

Callers 1

ContainsSQLMethod · 0.95

Calls 1

SQLStringMethod · 0.65

Tested by

no test coverage detected