(s ...string)
| 13 | type postgresHelper struct{} |
| 14 | |
| 15 | func (p *postgresHelper) Concat(s ...string) string { |
| 16 | if len(s) == 1 { |
| 17 | return s[0] |
| 18 | } |
| 19 | |
| 20 | return `CONCAT(` + strings.Join(s, ", ") + `)` |
| 21 | } |
| 22 | |
| 23 | func (p *postgresHelper) ParentMPath(levelKey string, mpathes ...string) string { |
| 24 | return `array_to_string(ARRAY(SELECT unnest(string_to_array(` + p.Concat(mpathes...) + `, '.')) LIMIT ` + levelKey + ` - 1), '.')` |
no test coverage detected