(levelKey string, mpathes ...string)
| 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), '.')` |
| 25 | } |
| 26 | |
| 27 | func (p *postgresHelper) Hash(s ...string) string { |
| 28 | return `ENCODE(DIGEST(` + p.Concat(s...) + `, 'sha1'), 'hex')` |