Lateral - initial commit.
This commit is contained in:
parent
1146afe343
commit
0cba1f6401
4 changed files with 73 additions and 2 deletions
13
postgres/lateral.go
Normal file
13
postgres/lateral.go
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package postgres
|
||||
|
||||
import "github.com/go-jet/jet/v2/internal/jet"
|
||||
|
||||
func LATERAL(selectStmt SelectStatement, alias string) SelectTable {
|
||||
subQuery := &selectTableImpl{
|
||||
SelectTable: jet.NewLateral(selectStmt, alias),
|
||||
}
|
||||
|
||||
subQuery.readableTableInterfaceImpl.parent = subQuery
|
||||
|
||||
return subQuery
|
||||
}
|
||||
9
postgres/lateral_test.go
Normal file
9
postgres/lateral_test.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package postgres
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestLATERAL(t *testing.T) {
|
||||
assertSerialize(t, LATERAL(SELECT(Int(1)), "lat1"), `LATERAL (
|
||||
SELECT $1
|
||||
) AS lat1`)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue