jet icon indicating copy to clipboard operation
jet copied to clipboard

Add Postgres GENERATE_SERIES function

Open BranislavLazic opened this issue 1 year ago • 2 comments
trafficstars

Adds GENERATE_SERIES function https://www.postgresql.org/docs/current/functions-srf.html I could also add the GENERATE_SUBSCRIPTS function but it has to wait for array expressions https://github.com/go-jet/jet/pull/380.

BranislavLazic avatar Sep 29 '24 12:09 BranislavLazic

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.49%. Comparing base (6a0798e) to head (dfafd14). Report is 29 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #397   +/-   ##
=======================================
  Coverage   90.49%   90.49%           
=======================================
  Files         125      125           
  Lines        7458     7463    +5     
=======================================
+ Hits         6749     6754    +5     
  Misses        550      550           
  Partials      159      159           
Flag Coverage Δ
90.49% <100.00%> (+<0.01%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Sep 29 '24 13:09 codecov-commenter

Note that generate_series can be used as table source and expression:

SELECT * 
FROM generate_series(2,4); -- table source
SELECT generate_series(2,4); -- expression

With this PR the expression use case would be supported, but not the table source. Now to support table source it is a bit more work. I'm wondering if is it worth supporting the table source at all. At least to my knowledge everything that can be done with generate_series as a table source can be also done as an expression.

go-jet avatar Oct 02 '24 10:10 go-jet

I guess we can go with just expression form, and revisit the other form if needed.

go-jet avatar Oct 28 '24 11:10 go-jet