Add support for WITH statements and Common Table Expressions.
This commit is contained in:
parent
0d3ec872d6
commit
fb8607da29
13 changed files with 406 additions and 39 deletions
|
|
@ -32,13 +32,7 @@ type Statement interface {
|
|||
type SerializerStatement interface {
|
||||
Serializer
|
||||
Statement
|
||||
}
|
||||
|
||||
// StatementWithProjections interface
|
||||
type StatementWithProjections interface {
|
||||
Statement
|
||||
HasProjections
|
||||
Serializer
|
||||
}
|
||||
|
||||
// HasProjections interface
|
||||
|
|
@ -163,7 +157,7 @@ type statementImpl struct {
|
|||
func (s *statementImpl) projections() ProjectionList {
|
||||
for _, clause := range s.Clauses {
|
||||
if selectClause, ok := clause.(ClauseWithProjections); ok {
|
||||
return selectClause.projections()
|
||||
return selectClause.Projections()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -171,7 +165,6 @@ func (s *statementImpl) projections() ProjectionList {
|
|||
}
|
||||
|
||||
func (s *statementImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
|
||||
|
||||
if !contains(options, NoWrap) {
|
||||
out.WriteString("(")
|
||||
out.IncreaseIdent()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue