mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-18 13:41:49 +03:00
29e33ed2b1
- Implemented "unique" function - Implemented "count_unique" function
22 lines
508 B
Go
22 lines
508 B
Go
package ast
|
|
|
|
import "github.com/neilotoole/sq/libsq/ast/internal/slq"
|
|
|
|
// UniqueNode implements the SQL "DISTINCT" clause.
|
|
type UniqueNode struct {
|
|
baseNode
|
|
}
|
|
|
|
// String returns a log/debug-friendly representation.
|
|
func (n *UniqueNode) String() string {
|
|
return nodeString(n)
|
|
}
|
|
|
|
// VisitUniqueFunc implements slq.SLQVisitor.
|
|
func (v *parseTreeVisitor) VisitUniqueFunc(ctx *slq.UniqueFuncContext) interface{} {
|
|
node := &UniqueNode{}
|
|
node.ctx = ctx
|
|
node.text = ctx.GetText()
|
|
return v.cur.AddChild(node)
|
|
}
|