Skip to content

Conversation

@t2y
Copy link
Contributor

@t2y t2y commented Mar 6, 2018

I implemented GROUP BY clause referring ORDER BY clause.

To be useful with GroupBy, I think we need to give the built in function in sql with columns. genmai already expose Function struct, so I added Grouping struct to be able to use it with grouping columns.

I'm not sure genmai design, I need review and help.

  • should I add general AS clause?

I added the feature to Function struct to be able to rename column name for minimum impacts. If genmai should support general AS clause, I will add the feature before GroupBy. What do you think?

type Function struct {
	...

	// alias name (optional).
	As string
}
  • which is the priority number appropriate?

I just set 300 as same as OrderBy.

	return c.appendQuery(300, GroupBy, groupbys)

@t2y
Copy link
Contributor Author

t2y commented Mar 6, 2018

hmm, postgres has failed ...

@t2y t2y force-pushed the support-group-by branch from d7f09de to 2981d0a Compare March 6, 2018 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant