...

Source file src/github.com/doug-martin/goqu/v9/exp/cte.go

Documentation: github.com/doug-martin/goqu/v9/exp

     1  package exp
     2  
     3  type commonExpr struct {
     4  	recursive bool
     5  	name      LiteralExpression
     6  	subQuery  Expression
     7  }
     8  
     9  // Creates a new WITH common table expression for a SQLExpression, typically Datasets'. This function is used
    10  // internally by Dataset when a CTE is added to another Dataset
    11  func NewCommonTableExpression(recursive bool, name string, subQuery Expression) CommonTableExpression {
    12  	return commonExpr{recursive: recursive, name: NewLiteralExpression(name), subQuery: subQuery}
    13  }
    14  
    15  func (ce commonExpr) Expression() Expression { return ce }
    16  
    17  func (ce commonExpr) Clone() Expression {
    18  	return commonExpr{recursive: ce.recursive, name: ce.name, subQuery: ce.subQuery.Clone().(SQLExpression)}
    19  }
    20  
    21  func (ce commonExpr) IsRecursive() bool       { return ce.recursive }
    22  func (ce commonExpr) Name() LiteralExpression { return ce.name }
    23  func (ce commonExpr) SubQuery() Expression    { return ce.subQuery }
    24  

View as plain text