hediet / ts-typed-sql

A fully typed sql builder. Not maintained anymore, use it for your inspiration.
https://hediet.github.io/ts-typed-sql/
54 stars 4 forks source link

Allow tuples #1

Open phiresky opened 7 years ago

phiresky commented 7 years ago

e.g.

select mensa.meals where (_mensaid, _lineid) in ((a,b), (c,d))

hediet commented 7 years ago

Are you fine with this syntax:

select(mensa.meals).where(
  tuple(mensa.id, mensa.lineId).isIn( [tuple(a, b), tuple(c, d)] )
)

?

phiresky commented 7 years ago

yeah. Might be good to investigate what exactly the differences are in PG between ROW(1,2,3), values(1,2,3) etc.