Closed mattkrick closed 6 months ago
Love this project! Thanks for all your work on it. I wanted to see if there's any interest in supporting functions in selectFrom.
selectFrom
Here's my example query:
SELECT NEXTVAL('"mySequence"') FROM GENERATE_SERIES(1, 1000)
To achieve that today, the closest I could get without pulling too many escape hatches is
db.selectFrom(sql.raw('generate_series(1,1000)')) .select((pg) => pg.fn<number>('NEXTVAL', [sql.lit('"mySequence"')]).as('seqId')) .execute()
ideally, it'd be nice to get the function params outside of the raw sql:
// error! doesn't work db.selectFrom((eb) => eb.fn('generate_series', [1,1000]))
What do you think? If this is possible today, please let me know!
Already supported. https://kyse.link/y5j6s
Love this project! Thanks for all your work on it. I wanted to see if there's any interest in supporting functions in
selectFrom
.Here's my example query:
To achieve that today, the closest I could get without pulling too many escape hatches is
ideally, it'd be nice to get the function params outside of the raw sql:
What do you think? If this is possible today, please let me know!