sqlc-dev / sqlc-gen-typescript

364 stars 17 forks source link

Support for sqlc.embed #42

Open masar3141 opened 1 month ago

masar3141 commented 1 month ago

As per the doc;

-- name: ScoreAndTests :many
SELECT sqlc.embed(students), sqlc.embed(test_scores)
FROM students
JOIN test_scores ON test_scores.student_id = students.id
WHERE students.id = $1;

produce this interface:

export interface ScoreAndTestsRow {
    students: string | null;
    testScores: string | null;
}

where we would expect

export interface ScoreAndTestsRow {
    students: Student;
    testScores: TestScore;
}