Problem
JSON values are inferred as JsonValue in TypedSQL (with Postgres). For example, if I create a query like SELECT id FROM users, typedSQL recognizes the id as a specific type. However, if I change it to SELECT json_build_object('id', id) as user_data FROM users, user_data is seen as JsonValue.
Suggested solution
I would see it beneficial for typedSQL to recognize the types within the JSON to generate more specific types. For e.g. the user_data in the example SELECT json_build_object('id', id) as user_data FROM users would result as {id: number} instead of JsonValue.