Lateral - initial commit.
This commit is contained in:
parent
1146afe343
commit
0cba1f6401
4 changed files with 73 additions and 2 deletions
|
|
@ -13,8 +13,8 @@ type selectTableImpl struct {
|
|||
}
|
||||
|
||||
// NewSelectTable func
|
||||
func NewSelectTable(selectStmt SerializerStatement, alias string) SelectTable {
|
||||
selectTable := &selectTableImpl{selectStmt: selectStmt, alias: alias}
|
||||
func NewSelectTable(selectStmt SerializerStatement, alias string) selectTableImpl {
|
||||
selectTable := selectTableImpl{selectStmt: selectStmt, alias: alias}
|
||||
return selectTable
|
||||
}
|
||||
|
||||
|
|
@ -38,3 +38,21 @@ func (s selectTableImpl) serialize(statement StatementType, out *SQLBuilder, opt
|
|||
out.WriteString("AS")
|
||||
out.WriteIdentifier(s.alias)
|
||||
}
|
||||
|
||||
// --------------------------------------
|
||||
|
||||
type lateralImpl struct {
|
||||
selectTableImpl
|
||||
}
|
||||
|
||||
func NewLateral(selectStmt SerializerStatement, alias string) SelectTable {
|
||||
return lateralImpl{selectTableImpl: NewSelectTable(selectStmt, alias)}
|
||||
}
|
||||
|
||||
func (s lateralImpl) serialize(statement StatementType, out *SQLBuilder, options ...SerializeOption) {
|
||||
out.WriteString("LATERAL")
|
||||
s.selectStmt.serialize(statement, out)
|
||||
|
||||
out.WriteString("AS")
|
||||
out.WriteIdentifier(s.alias)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue