-
Notifications
You must be signed in to change notification settings - Fork 213
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from doug-martin/v9.6.0-rc
V9.6.0 rc
- Loading branch information
Showing
14 changed files
with
253 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package exp | ||
|
||
type ( | ||
lateral struct { | ||
table AppendableExpression | ||
} | ||
) | ||
|
||
// Creates a new SQL lateral expression | ||
// L(From("test")) -> LATERAL (SELECT * FROM "tests") | ||
func NewLateralExpression(table AppendableExpression) LateralExpression { | ||
return lateral{table: table} | ||
} | ||
|
||
func (l lateral) Clone() Expression { | ||
return NewLateralExpression(l.table) | ||
} | ||
|
||
func (l lateral) Table() AppendableExpression { | ||
return l.table | ||
} | ||
|
||
func (l lateral) Expression() Expression { return l } | ||
func (l lateral) As(val interface{}) AliasedExpression { return aliased(l, val) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package exp | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/stretchr/testify/suite" | ||
) | ||
|
||
type lateralExpressionSuite struct { | ||
suite.Suite | ||
} | ||
|
||
func TestLateralExpressionSuite(t *testing.T) { | ||
suite.Run(t, &lateralExpressionSuite{}) | ||
} | ||
|
||
func (les *lateralExpressionSuite) TestClone() { | ||
le := NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{})) | ||
les.Equal(NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{})), le.Clone()) | ||
} | ||
|
||
func (les *lateralExpressionSuite) TestExpression() { | ||
le := NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{})) | ||
les.Equal(le, le.Expression()) | ||
} | ||
|
||
func (les *lateralExpressionSuite) TestLateral() { | ||
le := NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{})) | ||
les.Equal(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{}), le.Table()) | ||
} | ||
|
||
func (les *lateralExpressionSuite) TestAs() { | ||
le := NewLateralExpression(newTestAppendableExpression(`SELECT * FROM "test"`, []interface{}{})) | ||
les.Equal(aliased(le, "foo"), le.As("foo")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters