adelsz / pgtyped

pgTyped - Typesafe SQL in TypeScript
https://pgtyped.dev
MIT License
2.93k stars 95 forks source link

Supporting dynamic column selection #446

Open gilgardosh opened 2 years ago

gilgardosh commented 2 years ago

It would be amazing if there was a method to dynamically choose the columns being SELECTed.

something like SELECT :columns FROM TABLE_NAME

This feature will help various use-cases, prominently GraphQL servers in which the wanted values vary based on the client request.

adelsz commented 2 years ago

What would the type signature of such a query executor look like?

gilgardosh commented 2 years ago

@adelsz here is an example