jet/mysql/lateral.go

25 lines
510 B
Go
Raw Normal View History

2021-05-03 19:31:04 +02:00
package mysql
import "github.com/Gleipnir-Technology/jet/internal/jet"
2021-05-03 19:31:04 +02:00
2021-05-16 19:10:43 +02:00
// LATERAL derived tables constructor from select statement
2021-05-03 19:31:04 +02:00
func LATERAL(selectStmt SelectStatement) lateralImpl {
return lateralImpl{
selectStmt: selectStmt,
}
}
type lateralImpl struct {
selectStmt SelectStatement
}
func (l lateralImpl) AS(alias string) SelectTable {
subQuery := &selectTableImpl{
SelectTable: jet.NewLateral(l.selectStmt, alias),
}
subQuery.readableTableInterfaceImpl.root = subQuery
2021-05-03 19:31:04 +02:00
return subQuery
}