export GroupByClause type through alias
This commit is contained in:
parent
f0bf2c36b3
commit
c47d79ffd7
4 changed files with 12 additions and 5 deletions
|
|
@ -43,7 +43,7 @@ type SelectStatement interface {
|
||||||
DISTINCT() SelectStatement
|
DISTINCT() SelectStatement
|
||||||
FROM(tables ...ReadableTable) SelectStatement
|
FROM(tables ...ReadableTable) SelectStatement
|
||||||
WHERE(expression BoolExpression) SelectStatement
|
WHERE(expression BoolExpression) SelectStatement
|
||||||
GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement
|
GROUP_BY(groupByClauses ...GroupByClause) SelectStatement
|
||||||
HAVING(boolExpression BoolExpression) SelectStatement
|
HAVING(boolExpression BoolExpression) SelectStatement
|
||||||
WINDOW(name string) windowExpand
|
WINDOW(name string) windowExpand
|
||||||
ORDER_BY(orderByClauses ...OrderByClause) SelectStatement
|
ORDER_BY(orderByClauses ...OrderByClause) SelectStatement
|
||||||
|
|
@ -118,7 +118,7 @@ func (s *selectStatementImpl) WHERE(condition BoolExpression) SelectStatement {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *selectStatementImpl) GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement {
|
func (s *selectStatementImpl) GROUP_BY(groupByClauses ...GroupByClause) SelectStatement {
|
||||||
s.GroupBy.List = groupByClauses
|
s.GroupBy.List = groupByClauses
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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.
|
// OrderByClause is the combination of an expression and the wanted ordering to use as input for ORDER BY.
|
||||||
type OrderByClause = jet.OrderByClause
|
type OrderByClause = jet.OrderByClause
|
||||||
|
|
||||||
|
// GroupByClause interface to use as input for GROUP_BY
|
||||||
|
type GroupByClause = jet.GroupByClause
|
||||||
|
|
||||||
// SetLogger sets automatic statement logging
|
// SetLogger sets automatic statement logging
|
||||||
var SetLogger = jet.SetLoggerFunc
|
var SetLogger = jet.SetLoggerFunc
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package postgres
|
package postgres
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/go-jet/jet/v2/internal/jet"
|
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
|
"github.com/go-jet/jet/v2/internal/jet"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RowLock is interface for SELECT statement row lock types
|
// RowLock is interface for SELECT statement row lock types
|
||||||
|
|
@ -46,7 +47,7 @@ type SelectStatement interface {
|
||||||
DISTINCT() SelectStatement
|
DISTINCT() SelectStatement
|
||||||
FROM(tables ...ReadableTable) SelectStatement
|
FROM(tables ...ReadableTable) SelectStatement
|
||||||
WHERE(expression BoolExpression) SelectStatement
|
WHERE(expression BoolExpression) SelectStatement
|
||||||
GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement
|
GROUP_BY(groupByClauses ...GroupByClause) SelectStatement
|
||||||
HAVING(boolExpression BoolExpression) SelectStatement
|
HAVING(boolExpression BoolExpression) SelectStatement
|
||||||
WINDOW(name string) windowExpand
|
WINDOW(name string) windowExpand
|
||||||
ORDER_BY(orderByClauses ...OrderByClause) SelectStatement
|
ORDER_BY(orderByClauses ...OrderByClause) SelectStatement
|
||||||
|
|
@ -121,7 +122,7 @@ func (s *selectStatementImpl) WHERE(condition BoolExpression) SelectStatement {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *selectStatementImpl) GROUP_BY(groupByClauses ...jet.GroupByClause) SelectStatement {
|
func (s *selectStatementImpl) GROUP_BY(groupByClauses ...GroupByClause) SelectStatement {
|
||||||
s.GroupBy.List = groupByClauses
|
s.GroupBy.List = groupByClauses
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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.
|
// OrderByClause is the combination of an expression and the wanted ordering to use as input for ORDER BY.
|
||||||
type OrderByClause = jet.OrderByClause
|
type OrderByClause = jet.OrderByClause
|
||||||
|
|
||||||
|
// GroupByClause interface to use as input for GROUP_BY
|
||||||
|
type GroupByClause = jet.GroupByClause
|
||||||
|
|
||||||
// SetLogger sets automatic statement logging
|
// SetLogger sets automatic statement logging
|
||||||
var SetLogger = jet.SetLoggerFunc
|
var SetLogger = jet.SetLoggerFunc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue