1 comment

[ 3.0 ms ] story [ 18.0 ms ] thread
This is a source generator where you put in TypeScript describing a hierarchy of related database tables, and it produces:

(1) SQL for getting the data in a single round trip using SQL/JSON functions, and

(2) result types matching the query result structures, in either TypeScript or Java.

All tables, fields and foreign key relationships (usually used implicitly) are checked against database metadata for validity when sources are generated.

The idea is that there's no special runtime support necessary, the SQL can be directly executed and results deserialized to the generated result types directly using common facilities like JSON.parse() in TS or Jackson in Java.

Supported databases are Postgres (12+ tested), MySQL (8), Oracle (19+, maybe 18).

Target languages for the result types are TypeScript and Java.