ufoss-org / kotysa

The idiomatic way to write type-safe SQL in Kotlin
The Unlicense
117 stars 1 forks source link

SelectSum is only available for IntColumn #143

Closed guitcastro closed 1 year ago

guitcastro commented 1 year ago

Make selectSum available for NumericColumn as selectAvg

pull-vert commented 1 year ago

Hi @guitcastro , thanks again for your feedbacks and new feature ideas The current selectSum operation in Kotysa returns a Long, whereas selectAvg returns a BigDecimal because the average operation on several Int or Long can resolve to a decimal result.

Considering this difference in return type, I cannot make selectSum with a Long result type to sum decimal columns.

For now I will just add support for LongColumn, and later I could add a new selectSum operation that return a BigDecimal for the decimal column types (Float, Long, BigDecimal).

guitcastro commented 1 year ago

Ok! I need selectSum to aggregate transaction values. For now, I am just selecting all values and summing in the client side.

I would love to create a PR to fix it, but for now we are too busy with dead lines. I hope this change too so I can give back to this project!

pull-vert commented 1 year ago

thanks a lot in advance, I must admit that I am strongly busy at work and with family life too :slightly_smiling_face: I started to work on the 3.1.0 issues, I am planning to release it in July I think.

guitcastro commented 1 year ago

@pull-vert Take your time, I am just creating the issues because it's what I can do to help for now. Anyway, thanks for the awesome project :)