-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
41 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,46 @@ | ||
package sol | ||
|
||
// Function adds a generic function to the column | ||
func Function(name string, col Columnar) ColumnElem { | ||
return col.Column().AddOperator(name) | ||
} | ||
|
||
// Avg returns a column wrapped in the AVG() function | ||
func Avg(expression Columnar) ColumnElem { | ||
return Function("AVG", expression) | ||
} | ||
|
||
// Count returns a column wrapped in the COUNT() function | ||
func Count(expression Columnar) ColumnElem { | ||
return Function("COUNT", expression) | ||
} | ||
|
||
// Date returns a column wrapped in the DATE() function | ||
func Date(expression Columnar) ColumnElem { | ||
return Function("DATE", expression) | ||
} | ||
|
||
// Max returns a column wrapped in the MAX() function | ||
func Max(expression Columnar) ColumnElem { | ||
return Function("MAX", expression) | ||
} | ||
|
||
// Min returns a column wrapped in the MIN() function | ||
func Min(expression Columnar) ColumnElem { | ||
return Function("MIN", expression) | ||
} | ||
|
||
// StdDev returns a column wrapped in the STDDEV() function | ||
func StdDev(expression Columnar) ColumnElem { | ||
return Function("STDDEV", expression) | ||
} | ||
|
||
// Sum returns a column wrapped in the SUM() function | ||
func Sum(expression Columnar) ColumnElem { | ||
return Function("SUM", expression) | ||
} | ||
|
||
// Variance returns a column wrapped in the VARIANCE() function | ||
func Variance(expression Columnar) ColumnElem { | ||
return Function("VARIANCE", expression) | ||
} |
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
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 |
---|---|---|
|
@@ -232,7 +232,7 @@ func IntegrationTest(t *testing.T, conn *DB) { | |
// The client should be first | ||
if list[0].Email != "[email protected]" { | ||
t.Errorf( | ||
"Unexpected email: want [email protected], have %d", | ||
"Unexpected email: want [email protected], have %s", | ||
list[0].Email, | ||
) | ||
} | ||
|
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