| 110 | } |
| 111 | |
| 112 | func (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 | |
| 122 | func (g ACLMappingVar) ContainsSQL(cfg *sqltypes.SQLGenerator, other sqltypes.Node) (string, error) { |
| 123 | switch other.UseAs().(type) { |