diff --git a/mysql/select_statement.go b/mysql/select_statement.go index 8ebab03..ffb8054 100644 --- a/mysql/select_statement.go +++ b/mysql/select_statement.go @@ -43,7 +43,7 @@ type SelectStatement interface { DISTINCT() SelectStatement FROM(tables ...ReadableTable) SelectStatement WHERE(expression BoolExpression) SelectStatement - GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement + GROUP_BY(groupByClauses ...GroupByClause) SelectStatement HAVING(boolExpression BoolExpression) SelectStatement WINDOW(name string) windowExpand ORDER_BY(orderByClauses ...OrderByClause) SelectStatement @@ -118,7 +118,7 @@ func (s *selectStatementImpl) WHERE(condition BoolExpression) SelectStatement { return s } -func (s *selectStatementImpl) GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement { +func (s *selectStatementImpl) GROUP_BY(groupByClauses ...GroupByClause) SelectStatement { s.GroupBy.List = groupByClauses return s } diff --git a/mysql/types.go b/mysql/types.go index 8c6608f..c82962f 100644 --- a/mysql/types.go +++ b/mysql/types.go @@ -20,5 +20,8 @@ type PrintableStatement = jet.PrintableStatement // OrderByClause is the combination of an expression and the wanted ordering to use as input for ORDER BY. type OrderByClause = jet.OrderByClause +// GroupByClause interface to use as input for GROUP_BY +type GroupByClause = jet.GroupByClause + // SetLogger sets automatic statement logging var SetLogger = jet.SetLoggerFunc diff --git a/postgres/select_statement.go b/postgres/select_statement.go index 516ae25..8fb9cb6 100644 --- a/postgres/select_statement.go +++ b/postgres/select_statement.go @@ -1,8 +1,9 @@ package postgres import ( - "github.com/go-jet/jet/v2/internal/jet" "math" + + "github.com/go-jet/jet/v2/internal/jet" ) // RowLock is interface for SELECT statement row lock types @@ -46,7 +47,7 @@ type SelectStatement interface { DISTINCT() SelectStatement FROM(tables ...ReadableTable) SelectStatement WHERE(expression BoolExpression) SelectStatement - GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement + GROUP_BY(groupByClauses ...GroupByClause) SelectStatement HAVING(boolExpression BoolExpression) SelectStatement WINDOW(name string) windowExpand ORDER_BY(orderByClauses ...OrderByClause) SelectStatement @@ -121,7 +122,7 @@ func (s *selectStatementImpl) WHERE(condition BoolExpression) SelectStatement { return s } -func (s *selectStatementImpl) GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement { +func (s *selectStatementImpl) GROUP_BY(groupByClauses ...GroupByClause) SelectStatement { s.GroupBy.List = groupByClauses return s } diff --git a/postgres/types.go b/postgres/types.go index 05354b7..6fed21b 100644 --- a/postgres/types.go +++ b/postgres/types.go @@ -20,5 +20,8 @@ type PrintableStatement = jet.PrintableStatement // OrderByClause is the combination of an expression and the wanted ordering to use as input for ORDER BY. type OrderByClause = jet.OrderByClause +// GroupByClause interface to use as input for GROUP_BY +type GroupByClause = jet.GroupByClause + // SetLogger sets automatic statement logging var SetLogger = jet.SetLoggerFunc